From 5598cb4a21f497ddf5218a6096fb0946b3514ee1 Mon Sep 17 00:00:00 2001 From: Robert James Hernandez Date: Fri, 17 Jun 2016 14:58:23 -0700 Subject: [PATCH] Make docker.absent honor test=true --- salt/states/dockerng.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/salt/states/dockerng.py b/salt/states/dockerng.py index 6ad8a68cbe..9470e321d6 100644 --- a/salt/states/dockerng.py +++ b/salt/states/dockerng.py @@ -2056,6 +2056,11 @@ def absent(name, force=False): 'forcibly remove it') return ret + if __opts__['test']: + ret['result'] = None + ret['comment'] = ('Container \'{0}\' will be removed'.format(name)) + return ret + try: ret['changes']['removed'] = __salt__['dockerng.rm'](name, force=force) except Exception as exc: