mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Fixes dry run false positive when option value is a number.
This commit is contained in:
parent
70144bccbb
commit
0c0d10d18f
1 changed files with 3 additions and 2 deletions
|
@ -74,7 +74,7 @@ def options_present(name, sections=None, separator='=', strict=False):
|
|||
if __opts__['test']:
|
||||
for option in options:
|
||||
if option in original_top_level_opts:
|
||||
if original_top_level_opts[option] == options[option]:
|
||||
if six.text_type(original_top_level_opts[option]) == six.text_type(options[option]):
|
||||
ret['comment'] += 'Unchanged key {0}.\n'.format(option)
|
||||
else:
|
||||
ret['comment'] += 'Changed key {0}.\n'.format(option)
|
||||
|
@ -111,7 +111,8 @@ def options_present(name, sections=None, separator='=', strict=False):
|
|||
'after': None}})
|
||||
if __opts__['test']:
|
||||
for option in section_body:
|
||||
if section_body[option] == original_sections.get(section_name, {}).get(option, '#-#-'):
|
||||
if six.text_type(section_body[option]) == \
|
||||
six.text_type(original_sections.get(section_name, {}).get(option, '#-#-')):
|
||||
ret['comment'] += 'Unchanged key {0} in section {1}.\n'.format(option, section_name)
|
||||
else:
|
||||
ret['comment'] += 'Changed key {0} in section {1}.\n'.format(option, section_name)
|
||||
|
|
Loading…
Add table
Reference in a new issue