From 8a00171cb0bc4efae649e5368ca6f1f796891860 Mon Sep 17 00:00:00 2001 From: "John L. Villalovos" Date: Mon, 12 Oct 2015 09:47:49 -0700 Subject: [PATCH] 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 --- ironic/common/exception.py | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/ironic/common/exception.py b/ironic/common/exception.py index 9cbfd935f8..6e0fc756d5 100644 --- a/ironic/common/exception.py +++ b/ironic/common/exception.py @@ -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.")