summaryrefslogtreecommitdiff
path: root/ironic_python_agent/errors.py
diff options
context:
space:
mode:
authorJay Faulkner <jay@jvf.cc>2015-01-09 08:50:36 -0800
committerJay Faulkner <jay@jvf.cc>2015-01-09 17:02:37 +0000
commit49d547d97eedda85ef422078f38f023472a73dd7 (patch)
tree4cbd3931ff16251529cde5985555d8d8dd584d2f /ironic_python_agent/errors.py
parent2bbec5770c459b339b0924e8ffcd1382e22d44df (diff)
downloadironic-python-agent-49d547d97eedda85ef422078f38f023472a73dd7.tar.gz
HardwareManagerMethodNotFound requires a method
If this exception is called, it should contain a method argument. If not, allow the incorrect call to bubble up rather than setting it to None. This will ensure this error is never called without the method argument. Change-Id: Iedc82b3446d1ee41d6ae94ee43391e12ef4899a7
Diffstat (limited to 'ironic_python_agent/errors.py')
-rw-r--r--ironic_python_agent/errors.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/ironic_python_agent/errors.py b/ironic_python_agent/errors.py
index a7abdb30..0478feec 100644
--- a/ironic_python_agent/errors.py
+++ b/ironic_python_agent/errors.py
@@ -266,11 +266,8 @@ class HardwareManagerMethodNotFound(RESTError):
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
+ def __init__(self, method):
+ self.details = (self.msg + ': "{0}".').format(method)
super(HardwareManagerMethodNotFound, self).__init__(self.details)