mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
Merge pull request #16959 from whiteinge/apache_modules-test-mode
Fix apache_module states to return None and changes dict in test mode
This commit is contained in:
commit
060cae8edc
@ -66,6 +66,10 @@ def configfile(name, config):
|
||||
return ret
|
||||
elif __opts__['test']:
|
||||
ret['comment'] = 'Configuration will update.'
|
||||
ret['changes'] = {
|
||||
'old': current_configs,
|
||||
'new': configs
|
||||
}
|
||||
ret['result'] = None
|
||||
return ret
|
||||
|
||||
|
@ -41,6 +41,9 @@ def enable(name):
|
||||
if __opts__['test']:
|
||||
msg = 'Apache module {0} is set to be enabled.'.format(name)
|
||||
ret['comment'] = msg
|
||||
ret['changes']['old'] = None
|
||||
ret['changes']['new'] = name
|
||||
ret['result'] = None
|
||||
return ret
|
||||
status = __salt__['apache.a2enmod'](name)['Status']
|
||||
if isinstance(status, string_types) and 'enabled' in status:
|
||||
@ -72,6 +75,9 @@ def disable(name):
|
||||
if __opts__['test']:
|
||||
msg = 'Apache module {0} is set to be disabled.'.format(name)
|
||||
ret['comment'] = msg
|
||||
ret['changes']['old'] = name
|
||||
ret['changes']['new'] = None
|
||||
ret['result'] = None
|
||||
return ret
|
||||
status = __salt__['apache.a2dismod'](name)['Status']
|
||||
if isinstance(status, string_types) and 'disabled' in status:
|
||||
|
Loading…
Reference in New Issue
Block a user