diff options
author | Josh Gachnang <josh@pcsforeducation.com> | 2015-03-03 17:46:04 -0800 |
---|---|---|
committer | Josh Gachnang <josh@pcsforeducation.com> | 2015-03-17 17:07:04 -0700 |
commit | 5f4fa7f27ef33ca0c8ce4fe6917b1866ce8a8f56 (patch) | |
tree | 47d4e77203f0158f19752a33765ece4561fee7af /ironic_python_agent/errors.py | |
parent | be44ac8d4d1793b86ade6eef6f3b0f620779fc7e (diff) | |
download | ironic-python-agent-5f4fa7f27ef33ca0c8ce4fe6917b1866ce8a8f56.tar.gz |
Add cleaning/zapping support to IPA
This will add support for in band cleaning operations to IPA and
replace the decom API that was unused.
Adds API support for get_clean_steps, which returns a list of
supported clean steps for the node, execute_clean_step, to execute
one of the steps returned by get_clean_steps.
Adds versioning and naming for hardware managers, so if a new hardware
manager version is deployed in the middle of cleaning/zapping, the
cleaning/zapping will be restarted to avoid incompatabilities.
blueprint implement-cleaning-states
blueprint inband-raid-configuration
blueprint implement-zaping-states
Depends-On: Ia2500ed5afb72058b4c5e8f41307169381cbce48
Change-Id: I750b80b9bf98b3ddc5643bb4c14a67d2052239af
Diffstat (limited to 'ironic_python_agent/errors.py')
-rw-r--r-- | ironic_python_agent/errors.py | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/ironic_python_agent/errors.py b/ironic_python_agent/errors.py index ee2df169..5ddbf0a1 100644 --- a/ironic_python_agent/errors.py +++ b/ironic_python_agent/errors.py @@ -284,6 +284,38 @@ class IncompatibleHardwareMethodError(RESTError): super(IncompatibleHardwareMethodError, self).__init__(details) +class CleanVersionMismatch(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. + + """ + message = 'Clean version mismatch, reload agent with correct version' + + def __init__(self, agent_version, node_version): + self.status_code = 409 + details = ('Agent clean version: {0}, node clean version: {1}' + .format(agent_version, node_version)) + super(CleanVersionMismatch, self).__init__(details) + + +class CleaningError(RESTError): + """Error raised when a cleaning step fails.""" + message = 'Clean step failed.' + + def __init__(self, details=None): + if details is not None: + details = details + else: + details = self.message + super(CleaningError, self).__init__(details) + + class ISCSIError(RESTError): """Error raised when an image cannot be written to a device.""" |