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:
C. R. Oldham 2014-10-29 17:31:39 -04:00
commit 060cae8edc
2 changed files with 10 additions and 0 deletions

View File

@ -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

View File

@ -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: