From 49d547d97eedda85ef422078f38f023472a73dd7 Mon Sep 17 00:00:00 2001 From: Jay Faulkner <jay@jvf.cc> Date: Fri, 9 Jan 2015 08:50:36 -0800 Subject: [PATCH] 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 --- ironic_python_agent/errors.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/ironic_python_agent/errors.py b/ironic_python_agent/errors.py index a7abdb301..0478feec6 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)