diff options
| author | Dmitry Tantsur <dtantsur@protonmail.com> | 2020-10-09 11:22:09 +0200 |
|---|---|---|
| committer | Dmitry Tantsur <dtantsur@protonmail.com> | 2020-10-09 14:33:52 +0200 |
| commit | 7306c73e7e5ce695d478fbc38c192796d5a4f962 (patch) | |
| tree | c952333a4a098681c926e4b083d398174df2b7b3 /ironic_python_agent/extensions/base.py | |
| parent | d5ebdfe1b39f823d18c47650a089e450b69f87d9 (diff) | |
| download | ironic-python-agent-7306c73e7e5ce695d478fbc38c192796d5a4f962.tar.gz | |
Do not silently swallow errors in the write_image deploy step6.4.1
Calling join() does not raise, we need to explicitly check the result.
Change-Id: I81d3d727af220c2b50358edab8139f07874611f0
Story: #2008240
Task: #41083
(cherry picked from commit 420ebc0d73ccfa7248e93881c58a0e45fda0e718)
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.""" |
