Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement ExceptionHandlingInstaller #175

Merged
merged 2 commits into from
Apr 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions osbenchmark/builder/installers/exception_handling_installer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
from osbenchmark.builder.installers.installer import Installer
from osbenchmark.exceptions import InstallError


class ExceptionHandlingInstaller(Installer):
def __init__(self, installer, executor=None):
super().__init__(executor)
self.installer = installer

def install(self, host, binaries, all_node_ips):
try:
return self.installer.install(host, binaries, all_node_ips)
except Exception as e:
raise InstallError(f"Installing node on host \"{host}\" failed", e)

def cleanup(self, host):
try:
return self.installer.cleanup(host)
except Exception as e:
raise InstallError(f"Cleaning up install data on host \"{host}\" failed", e)
5 changes: 5 additions & 0 deletions osbenchmark/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ class LaunchError(BenchmarkError):
Thrown whenever there was a problem launching the benchmark candidate
"""

class InstallError(BenchmarkError):
"""
Thrown whenever there was a problem installing the benchmark candidate
"""


class ExecutorError(BenchmarkError):
"""
Expand Down