Make docker.absent honor test=true

This commit is contained in:
Robert James Hernandez 2016-06-17 14:58:23 -07:00
parent 92dc7936ca
commit 5598cb4a21

View File

@ -2056,6 +2056,11 @@ def absent(name, force=False):
'forcibly remove it') 'forcibly remove it')
return ret return ret
if __opts__['test']:
ret['result'] = None
ret['comment'] = ('Container \'{0}\' will be removed'.format(name))
return ret
try: try:
ret['changes']['removed'] = __salt__['dockerng.rm'](name, force=force) ret['changes']['removed'] = __salt__['dockerng.rm'](name, force=force)
except Exception as exc: except Exception as exc: