mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 09:23:56 +00:00
Merge pull request #35089 from calve/develop
Output changes to be applied on security group when test=True
This commit is contained in:
commit
38bee69fc8
@ -95,6 +95,7 @@ from __future__ import absolute_import
|
||||
|
||||
# Import Python libs
|
||||
import logging
|
||||
import pprint
|
||||
|
||||
# Import salt libs
|
||||
import salt.utils.dictupdate as dictupdate
|
||||
@ -418,7 +419,9 @@ def _rules_present(name, rules, vpc_id=None, vpc_name=None,
|
||||
to_delete, to_create = _get_rule_changes(rules, sg['rules'])
|
||||
if to_create or to_delete:
|
||||
if __opts__['test']:
|
||||
msg = 'Security group {0} set to have rules modified.'.format(name)
|
||||
msg = ('Security group {0} set to have rules modified.',
|
||||
'\nTo be created: {1}.\nTo be deleted: {2}').format(
|
||||
name, pprint.pformat(to_create), pprint.pformat(to_delete))
|
||||
ret['comment'] = msg
|
||||
ret['result'] = None
|
||||
return ret
|
||||
@ -499,7 +502,9 @@ def _rules_egress_present(name, rules_egress, vpc_id=None, vpc_name=None,
|
||||
)
|
||||
if to_create_egress or to_delete_egress:
|
||||
if __opts__['test']:
|
||||
msg = 'Security group {0} set to have rules modified.'.format(name)
|
||||
msg = ('Security group {0} set to have rules modified.'
|
||||
'\nTo be created: {1}.\nTo be deleted: {2}').format(
|
||||
name, pprint.pformat(to_create_egress), pprint.pformat(to_delete_egress))
|
||||
ret['comment'] = msg
|
||||
ret['result'] = None
|
||||
return ret
|
||||
|
Loading…
Reference in New Issue
Block a user