mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 17:09:03 +00:00
Set gem to return result of None if tests applied
This commit is contained in:
parent
66ab1602e1
commit
a70e4120b8
@ -26,7 +26,7 @@ def installed(name, ruby=None, runas=None):
|
|||||||
runas : None
|
runas : None
|
||||||
The user to run gem as.
|
The user to run gem as.
|
||||||
'''
|
'''
|
||||||
ret = {'name': name, 'result': False, 'comment': '', 'changes': {}}
|
ret = {'name': name, 'result': None, 'comment': '', 'changes': {}}
|
||||||
if name in __salt__['gem.list'](name, ruby, runas=runas):
|
if name in __salt__['gem.list'](name, ruby, runas=runas):
|
||||||
ret['result'] = True
|
ret['result'] = True
|
||||||
ret['comment'] = 'Gem is already installed.'
|
ret['comment'] = 'Gem is already installed.'
|
||||||
@ -65,6 +65,7 @@ def removed(name, ruby=None, runas=None):
|
|||||||
|
|
||||||
if __opts__['test']:
|
if __opts__['test']:
|
||||||
ret['comment'] = 'The gem {0} would have been removed'.format(name)
|
ret['comment'] = 'The gem {0} would have been removed'.format(name)
|
||||||
|
return ret
|
||||||
if __salt__['gem.uninstall'](name, ruby, runas=runas):
|
if __salt__['gem.uninstall'](name, ruby, runas=runas):
|
||||||
ret['result'] = True
|
ret['result'] = True
|
||||||
ret['changes'][name] = 'Removed'
|
ret['changes'][name] = 'Removed'
|
||||||
|
Loading…
Reference in New Issue
Block a user