Merge pull request #40235 from lorengordon/lgpo-deepdiff

Uses a deep diff to compare lgpo policy changes
This commit is contained in:
Mike Place 2017-03-22 16:31:20 -06:00 committed by GitHub
commit cae6a378f9

View File

@ -108,6 +108,9 @@ from __future__ import absolute_import
import logging
import json
# Import salt libs
import salt.utils.dictdiffer
# Import 3rd party libs
import salt.ext.six as six
@ -298,10 +301,11 @@ def set_(name,
adml_language=adml_language)
if _ret:
ret['result'] = _ret
ret['changes']['old'] = current_policy
ret['changes']['new'] = __salt__['lgpo.get'](policy_class=policy_class,
adml_language=adml_language,
hierarchical_return=False)
ret['changes'] = salt.utils.dictdiffer.deep_diff(
current_policy,
__salt__['lgpo.get'](policy_class=policy_class,
adml_language=adml_language,
hierarchical_return=False))
else:
ret['result'] = False
ret['comment'] = 'Errors occurred while attempting to configure policies: {0}'.format(_ret)