summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg Lutostanski <greg.lutostanski@calxeda.com>2013-12-11 10:50:31 -0600
committerGreg Lutostanski <greg.lutostanski@calxeda.com>2013-12-13 14:09:58 -0600
commitd0fa3cd9390453d1d79f262635af60cdf1b449b4 (patch)
tree4fa97308471048b571774dc2a1e2a09755971286
parent8420d24b4bd80524a6ef94b3fbebe10e2d2c64e5 (diff)
downloadcxmanage-d0fa3cd9390453d1d79f262635af60cdf1b449b4.tar.gz
CXMAN-272: Add NodeMismatchError for node.refresh()
-rw-r--r--cxmanage_api/cx_exceptions.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/cxmanage_api/cx_exceptions.py b/cxmanage_api/cx_exceptions.py
index 5e0c931..7ea2fe7 100644
--- a/cxmanage_api/cx_exceptions.py
+++ b/cxmanage_api/cx_exceptions.py
@@ -296,6 +296,32 @@ class InvalidImageError(Exception):
return self.msg
+class NodeMismatchError(Exception):
+ """Raised when a node that is supposed to be an updated version of the
+ current node is not.
+
+ >>> from cxmanage_api.cx_exceptions import NodeMismatchError
+ >>> raise InvalidImageError('My custom exception text!')
+ Traceback (most recent call last):
+ File "<stdin>", line 1, in <module>
+ cxmanage_api.cx_exceptions.InvalidImageError: My custom exception text!
+
+ :param msg: Exceptions message and details to return to the user.
+ :type msg: string
+ :raised: When a node passed in to refresh() another node does not match.
+
+ """
+
+ def __init__(self, msg):
+ """Default constructor for the NodeMismatchError class."""
+ super(NodeMismatchError, self).__init__()
+ self.msg = msg
+
+ def __str__(self):
+ """String representation of this Exception class."""
+ return self.msg
+
+
class UbootenvError(Exception):
"""Raised when the UbootEnv class fails to interpret the ubootenv
environment variables.