diff options
| author | Jenkins <jenkins@review.openstack.org> | 2015-01-09 17:34:01 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2015-01-09 17:34:01 +0000 |
| commit | d26324e12b9adaa4e5fc954734cfbb19107161d2 (patch) | |
| tree | 2de6dee4bd51dd60f147fd25d42e19950fd6efe0 /ironic_python_agent/errors.py | |
| parent | d95a99d5d1a62ef5c085ce20ec07d960a3f23ac1 (diff) | |
| parent | 2bbec5770c459b339b0924e8ffcd1382e22d44df (diff) | |
| download | ironic-python-agent-d26324e12b9adaa4e5fc954734cfbb19107161d2.tar.gz | |
Merge "Allow use of multiple simultaneous HW managers"
Diffstat (limited to 'ironic_python_agent/errors.py')
| -rw-r--r-- | ironic_python_agent/errors.py | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/ironic_python_agent/errors.py b/ironic_python_agent/errors.py index 7219fbda..a7abdb30 100644 --- a/ironic_python_agent/errors.py +++ b/ironic_python_agent/errors.py @@ -247,3 +247,43 @@ class UnknownNodeError(Exception): if message is not None: self.message = message super(UnknownNodeError, self).__init__(self.message) + + +class HardwareManagerNotFound(Exception): + """Error raised when no valid HardwareManager can be found.""" + + message = 'No valid HardwareManager found.' + + def __init__(self, message=None): + if message is not None: + self.message = message + super(HardwareManagerNotFound, self).__init__(self.message) + + +class HardwareManagerMethodNotFound(RESTError): + """Error raised when all HardwareManagers fail to handle a method.""" + + msg = 'No HardwareManager found to handle method' + message = msg + '.' + + def __init__(self, method=None): + if method is not None: + self.details = (self.msg + ': "{0}".').format(method) + else: + self.details = self.message + super(HardwareManagerMethodNotFound, self).__init__(self.details) + + +class IncompatibleHardwareMethodError(RESTError): + """Error raised when HardwareManager method is incompatible with node + hardware. + """ + + message = 'HardwareManager method is not compatible with hardware.' + + def __init__(self, details=None): + if details is not None: + self.details = details + else: + self.details = self.message + super(IncompatibleHardwareMethodError, self).__init__(self.details) |
