From 54d40fe557ddac6a6c35c101e8241b4f5943ab62 Mon Sep 17 00:00:00 2001 From: Alvaro Aleman Date: Mon, 25 Jul 2016 20:05:58 +0200 Subject: [PATCH] Ensure os_project checks the right domain (#2519) --- .../modules/extras/cloud/openstack/os_project.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/ansible/modules/extras/cloud/openstack/os_project.py b/lib/ansible/modules/extras/cloud/openstack/os_project.py index 630b26c411..eeaa101e66 100644 --- a/lib/ansible/modules/extras/cloud/openstack/os_project.py +++ b/lib/ansible/modules/extras/cloud/openstack/os_project.py @@ -111,7 +111,7 @@ def _needs_update(module, project): keys = ('description', 'enabled') for key in keys: if module.params[key] is not None and module.params[key] != project.get(key): - return True + return True return False @@ -176,9 +176,13 @@ def main(): except: # Ok, let's hope the user is non-admin and passing a sane id pass - + cloud = shade.openstack_cloud(**module.params) - project = cloud.get_project(name) + + if domain: + project = cloud.get_project(name, domain_id=domain) + else: + project = cloud.get_project(name) if module.check_mode: module.exit_json(changed=_system_state_change(module, project))