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
This commit is contained in:
Jay Faulkner 2015-01-09 08:50:36 -08:00
parent 2bbec5770c
commit 49d547d97e

@ -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)