summaryrefslogtreecommitdiff
path: root/ironic_python_agent/errors.py
diff options
context:
space:
mode:
authorMark Goddard <mark@stackhpc.com>2019-12-12 17:13:08 +0000
committerDmitry Tantsur <dtantsur@protonmail.com>2020-04-06 10:24:08 +0200
commit1b4ce47921b6a09fbf2894b021217a87d82fe7aa (patch)
treea1c0ec6b840c705658c51cb079d12d0b80a1e415 /ironic_python_agent/errors.py
parent0edb9d9f61ba8734949f49112e93b4b1ca211721 (diff)
downloadironic-python-agent-1b4ce47921b6a09fbf2894b021217a87d82fe7aa.tar.gz
Add an ability to run in-band deploy steps
Mostly adaptation of cleaning methods. Co-Authored-By: Dmitry Tantsur <dtantsur@redhat.com> Change-Id: Ife0502391bbece46d619a20a825dfdb191d5c2b4 Story: 2006963 Task: 37791
Diffstat (limited to 'ironic_python_agent/errors.py')
-rw-r--r--ironic_python_agent/errors.py31
1 files changed, 21 insertions, 10 deletions
diff --git a/ironic_python_agent/errors.py b/ironic_python_agent/errors.py
index d263af5f..99bbe2b8 100644
--- a/ironic_python_agent/errors.py
+++ b/ironic_python_agent/errors.py
@@ -263,24 +263,26 @@ class IncompatibleHardwareMethodError(RESTError):
super(IncompatibleHardwareMethodError, self).__init__(details)
-class CleanVersionMismatch(RESTError):
+class VersionMismatch(RESTError):
"""Error raised when Ironic and the Agent have different versions.
- If the agent version has changed since get_clean_steps was called by
- the Ironic conductor, it indicates the agent has been updated (either
- on purpose, or a new agent was deployed and the node was rebooted).
- Since we cannot know if the upgraded IPA will work with cleaning as it
- stands (steps could have different priorities, either in IPA or in
- other Ironic interfaces), we should restart cleaning from the start.
+ If the agent version has changed since get_clean_steps or get_deploy_steps
+ was called by the Ironic conductor, it indicates the agent has been updated
+ (either on purpose, or a new agent was deployed and the node was rebooted).
+ Since we cannot know if the upgraded IPA will work with cleaning/deploy as
+ it stands (steps could have different priorities, either in IPA or in
+ other Ironic interfaces), we should restart the process from the start.
"""
- message = 'Clean version mismatch, reload agent with correct version'
+ message = (
+ 'Hardware managers version mismatch, reload agent with correct version'
+ )
def __init__(self, agent_version, node_version):
self.status_code = 409
- details = ('Agent clean version: {}, node clean version: {}'
+ details = ('Current versions: {}, versions used by ironic: {}'
.format(agent_version, node_version))
- super(CleanVersionMismatch, self).__init__(details)
+ super(VersionMismatch, self).__init__(details)
class CleaningError(RESTError):
@@ -292,6 +294,15 @@ class CleaningError(RESTError):
super(CleaningError, self).__init__(details)
+class DeploymentError(RESTError):
+ """Error raised when a deploy step fails."""
+
+ message = 'Deploy step failed'
+
+ def __init__(self, details=None):
+ super(DeploymentError, self).__init__(details)
+
+
class ISCSIError(RESTError):
"""Error raised when an image cannot be written to a device."""