summaryrefslogtreecommitdiff
path: root/ironic_python_agent/errors.py
diff options
context:
space:
mode:
authorJim Rollenhagen <jim@jimrollenhagen.com>2014-09-10 14:22:23 -0700
committerJim Rollenhagen <jim@jimrollenhagen.com>2014-09-10 14:53:37 -0700
commita9f21797614c360561a869378375b85b7f003c39 (patch)
tree2702dda6b19d4d036ea57c9ed7e149deffb21e73 /ironic_python_agent/errors.py
parent123603edd97ece2bf9b7001b4850fe0ce9919a54 (diff)
downloadironic-python-agent-a9f21797614c360561a869378375b85b7f003c39.tar.gz
Fix exception that is not properly raised
This commit fixes an exception that was not properly raised, and also makes the exception more relevant. This also fixes an outstanding bug where, if the agent was not associated with a node, get_node_uuid() would fail in an unexpected manner. Change-Id: Ifca474a73dd50b5fd2242e5b7e938a5db04f27a8
Diffstat (limited to 'ironic_python_agent/errors.py')
-rw-r--r--ironic_python_agent/errors.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/ironic_python_agent/errors.py b/ironic_python_agent/errors.py
index 5c6bdb2c..7219fbda 100644
--- a/ironic_python_agent/errors.py
+++ b/ironic_python_agent/errors.py
@@ -236,3 +236,14 @@ class VirtualMediaBootError(RESTError):
class ExtensionError(Exception):
pass
+
+
+class UnknownNodeError(Exception):
+ """Error raised when the agent is not associated with an Ironic node."""
+
+ message = 'Agent is not associated with an Ironic node.'
+
+ def __init__(self, message=None):
+ if message is not None:
+ self.message = message
+ super(UnknownNodeError, self).__init__(self.message)