diff options
Diffstat (limited to 'ironic_python_agent/extensions/base.py')
| -rw-r--r-- | ironic_python_agent/extensions/base.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/ironic_python_agent/extensions/base.py b/ironic_python_agent/extensions/base.py index 93adfe93..23e47c46 100644 --- a/ironic_python_agent/extensions/base.py +++ b/ironic_python_agent/extensions/base.py @@ -79,6 +79,17 @@ class BaseCommandResult(encoding.SerializableComparable): """:returns: result of completed command.""" return self + def wait(self): + """Join the result and extract its value. + + Raises if the command failed. + """ + self.join() + if self.command_error is not None: + raise self.command_error + else: + return self.command_result + class SyncCommandResult(BaseCommandResult): """A result from a command that executes synchronously.""" |
