diff options
| author | Jeffrey Zhang <jeffrey.zhang@99cloud.net> | 2016-05-27 01:04:03 +0800 |
|---|---|---|
| committer | Jeffrey Zhang <jeffrey.zhang@99cloud.net> | 2016-05-30 23:02:09 +0800 |
| commit | 3545e6d503c7451921333134fb75d3fef3713952 (patch) | |
| tree | 85b8eaea64b145dcda82f86540db5423d2ad425d /ansible/library | |
| parent | b40bf517aeb894ed4b79985f66405507e0725ebd (diff) | |
| download | kolla-3545e6d503c7451921333134fb75d3fef3713952.tar.gz kolla-3545e6d503c7451921333134fb75d3fef3713952.zip | |
Fix the incompatibility for ansible 2.1.0
Ansible 2.1.0 has lots of change and the plugin is not compatible
between 2.0.0 and 2.1.0. This change fix the gap.
* fix the signature change for _make_tmp_path in ansible 2.1.0
* fix the common_options in the kolla_docker.py
Change-Id: I05f5f05581c8bd625cd868fa0db549d0c60a7043
Closes-Bug: #1586018
Diffstat (limited to 'ansible/library')
| -rw-r--r-- | ansible/library/kolla_docker.py | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/ansible/library/kolla_docker.py b/ansible/library/kolla_docker.py index e8e39490d..4930ad490 100644 --- a/ansible/library/kolla_docker.py +++ b/ansible/library/kolla_docker.py @@ -681,17 +681,12 @@ def generate_module(): required_together = [ ['tls_cert', 'tls_key'] ] - return AnsibleModule( + module = AnsibleModule( argument_spec=argument_spec, required_together=required_together, bypass_checks=True ) - -def generate_nested_module(): - module = generate_module() - - # We unnest the common dict and the update it with the other options new_args = module.params.pop('common_options', dict()) # NOTE(jeffrey4l): merge the environment @@ -704,16 +699,12 @@ def generate_nested_module(): continue new_args[key] = value - # Override ARGS to ensure new args are used - global MODULE_COMPLEX_ARGS - MODULE_COMPLEX_ARGS = json.dumps(new_args) - - # Reprocess the args now that the common dict has been unnested - return generate_module() + module.params = new_args + return module def main(): - module = generate_nested_module() + module = generate_module() # TODO(SamYaple): Replace with required_if when Ansible 2.0 lands if (module.params.get('action') in ['pull_image', 'start_container'] |
