Mask sensitive data when logging action results

When passwords or other sensible data is returned by a Action, they can
be logged by Mistral. This change uses the password masking
functionality used in mistral-lib and privided by oslo-utils.

This function uses the standard cut_repr method in mistral-lib, which
also means the output is more standardised.

Related-Bug: #1850843
Change-Id: I01bf47f7a83102a1a16b15bf0bbb4021707e11fe
This commit is contained in:
Dougal Matthews 2019-11-11 12:04:53 +00:00 committed by Dougal Matthews
parent a3bb6f08e3
commit a25c8fab88
1 changed files with 1 additions and 7 deletions

View File

@ -190,12 +190,6 @@ class Action(object):
def _log_result(self, prev_state, result): def _log_result(self, prev_state, result):
state = self.action_ex.state state = self.action_ex.state
def _result_msg():
if state == states.ERROR:
return "error = %s" % utils.cut(result.error)
return "result = %s" % utils.cut(result.data)
if prev_state != state: if prev_state != state:
wf_trace.info( wf_trace.info(
None, None,
@ -205,7 +199,7 @@ class Action(object):
self.task_ex.name if self.task_ex else None, self.task_ex.name if self.task_ex else None,
prev_state, prev_state,
state, state,
_result_msg()) result.cut_repr())
) )