Remove functions: _cleanse_dict & format_message
The functions _cleanse_dict & format_message are not used. _cleanse_dict was used previously by another function that was removed because it was unused. format_message usage has been removed as the correct way to get a message from an exception is six.text_type(exception). Remove it to prevent people from trying to use it. Closes-Bug: #1505080 Change-Id: I1a1284b0526787a62b6765bf2e3547dbba822352 Depends-On: I75757b5bd7d9e75ca37d1b9a1efff810ba84b5df
This commit is contained in:
parent
a64f423940
commit
8a00171cb0
@ -45,11 +45,6 @@ CONF = cfg.CONF
|
||||
CONF.register_opts(exc_log_opts)
|
||||
|
||||
|
||||
def _cleanse_dict(original):
|
||||
"""Strip all admin_password, new_pass, rescue_pass keys from a dict."""
|
||||
return dict((k, v) for k, v in original.items() if "_pass" not in k)
|
||||
|
||||
|
||||
class IronicException(Exception):
|
||||
"""Base Ironic Exception
|
||||
|
||||
@ -115,12 +110,6 @@ class IronicException(Exception):
|
||||
"""Return a unicode representation of the exception message."""
|
||||
return unicode(self.args[0])
|
||||
|
||||
def format_message(self):
|
||||
if self.__class__.__name__.endswith('_Remote'):
|
||||
return self.args[0]
|
||||
else:
|
||||
return six.text_type(self)
|
||||
|
||||
|
||||
class NotAuthorized(IronicException):
|
||||
_msg_fmt = _("Not authorized.")
|
||||
|
Loading…
Reference in New Issue
Block a user