Set gem to return result of None if tests applied

This commit is contained in:
Thomas S Hatch 2012-04-10 17:27:32 -06:00
parent 66ab1602e1
commit a70e4120b8

View File

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