diff --git a/atomicapp/providers/docker.py b/atomicapp/providers/docker.py index 1f208117..ec288d81 100644 --- a/atomicapp/providers/docker.py +++ b/atomicapp/providers/docker.py @@ -127,18 +127,9 @@ def undeploy(self): else: m = re.match("%s_+%s+_+[a-zA-Z0-9]{12}" % (self.namespace, self.image), container) if m: - logger.info("STOPPING AND REMOVING CONTAINER: %s", container) - cmd_list = [ - ["docker", "kill", container], - ["docker", "rm", container] - ] + logger.info("STOPPING CONTAINER: %s", container) + cmd = ["docker", "kill", container] if self.dryrun: - logger.info( - "DRY-RUN: STOPPING CONTAINER %s", " ".join( - cmd_list[0])) - logger.info( - "DRY-RUN: REMOVING CONTAINER %s", " ".join( - cmd_list[1])) + logger.info("DRY-RUN: STOPPING CONTAINER %s", " ".join(cmd)) else: - for cmd in cmd_list: - subprocess.check_call(cmd) + subprocess.check_call(cmd)