From 81fc92bd6602bce478a55506d326746a0eafee3e Mon Sep 17 00:00:00 2001 From: Toshio Kuratomi Date: Fri, 13 Mar 2015 10:23:10 -0700 Subject: [PATCH] Make state=running work for backwards compatibility with 1.8 --- cloud/docker/docker.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cloud/docker/docker.py b/cloud/docker/docker.py index 5f68179db67..8a4531b5277 100644 --- a/cloud/docker/docker.py +++ b/cloud/docker/docker.py @@ -1423,7 +1423,7 @@ def main(): env = dict(type='dict'), dns = dict(), detach = dict(default=True, type='bool'), - state = dict(default='started', choices=['present', 'started', 'reloaded', 'restarted', 'stopped', 'killed', 'absent']), + state = dict(default='started', choices=['present', 'started', 'reloaded', 'restarted', 'stopped', 'killed', 'absent', 'running']), restart_policy = dict(default=None, choices=['always', 'on-failure', 'no']), restart_policy_retry = dict(default=0, type='int'), debug = dict(default=False, type='bool'), @@ -1445,12 +1445,16 @@ def main(): try: manager = DockerManager(module) - state = module.params.get('state') count = int(module.params.get('count')) name = module.params.get('name') image = module.params.get('image') pull = module.params.get('pull') + state = module.params.get('state') + if state == 'running': + # Renamed running to started in 1.9 + state = 'started' + if count < 0: module.fail_json(msg="Count must be greater than zero")