aboutsummaryrefslogtreecommitdiff
path: root/ansible/library
diff options
context:
space:
mode:
authorJeffrey Zhang <jeffrey.zhang@99cloud.net>2016-05-17 20:16:42 +0800
committerJeffrey Zhang <jeffrey.zhang@99cloud.net>2016-05-24 19:53:31 +0800
commit491822c510ca9010d36aeecbcf7716828088cb1b (patch)
treea42aec37e58baa8fd2f610ed82405cbf2f8d988f /ansible/library
parentc98e9c44f23d14867e4dddea88fe9a9f7aa50dd6 (diff)
downloadkolla-491822c510ca9010d36aeecbcf7716828088cb1b.tar.gz
kolla-491822c510ca9010d36aeecbcf7716828088cb1b.zip
Bump the ansible to 2
DocImpact Change-Id: I3cdfbf84919de80f535c030bd146787ecda40dec partial-Implements: blueprint ansible2
Diffstat (limited to 'ansible/library')
-rw-r--r--ansible/library/kolla_docker.py21
1 files changed, 14 insertions, 7 deletions
diff --git a/ansible/library/kolla_docker.py b/ansible/library/kolla_docker.py
index 50d37deeb..e8e39490d 100644
--- a/ansible/library/kolla_docker.py
+++ b/ansible/library/kolla_docker.py
@@ -683,7 +683,8 @@ def generate_module():
]
return AnsibleModule(
argument_spec=argument_spec,
- required_together=required_together
+ required_together=required_together,
+ bypass_checks=True
)
@@ -691,15 +692,21 @@ def generate_nested_module():
module = generate_module()
# We unnest the common dict and the update it with the other options
- new_args = module.params.get('common_options')
- new_args.update(module._load_params()[0])
- module.params = new_args
+ new_args = module.params.pop('common_options', dict())
+
+ # NOTE(jeffrey4l): merge the environment
+ env = module.params.pop('environment', dict())
+ if env:
+ new_args['environment'].update(env)
+
+ for key, value in module.params.iteritems():
+ if key in new_args and value is None:
+ continue
+ new_args[key] = value
# Override ARGS to ensure new args are used
- global MODULE_ARGS
global MODULE_COMPLEX_ARGS
- MODULE_ARGS = ''
- MODULE_COMPLEX_ARGS = json.dumps(module.params)
+ MODULE_COMPLEX_ARGS = json.dumps(new_args)
# Reprocess the args now that the common dict has been unnested
return generate_module()