Simplify code by using mask_dict_password

A patch to oslo.utils was done to make mask_dict_password() work like
mask_password(). Using mask_dict_password() makes the code simpler and
easier to understand.

Change-Id: I3c34234eca11ff9d58ccdbbdc2d0114bdb6efebb
This commit is contained in:
John L. Villalovos 2016-08-05 14:36:21 -07:00
parent 48d59e4064
commit 6ad85298c4

View File

@ -13,7 +13,6 @@
# License for the specific language governing permissions and limitations
# under the License.
import ast
import datetime
from ironic_lib import metrics_utils
@ -802,9 +801,8 @@ class Node(base.APIBase):
bookmark=True)]
if not show_password and node.driver_info != wtypes.Unset:
node.driver_info = ast.literal_eval(strutils.mask_password(
node.driver_info,
"******"))
node.driver_info = strutils.mask_dict_password(node.driver_info,
"******")
# NOTE(lucasagomes): The numeric ID should not be exposed to
# the user, it's internal only.