diff options
Diffstat (limited to 'lib/ansible/modules/cloud/openstack')
5 files changed, 7 insertions, 7 deletions
diff --git a/lib/ansible/modules/cloud/openstack/os_keystone_domain_facts.py b/lib/ansible/modules/cloud/openstack/os_keystone_domain_facts.py index deb287e070..2c3a464436 100644 --- a/lib/ansible/modules/cloud/openstack/os_keystone_domain_facts.py +++ b/lib/ansible/modules/cloud/openstack/os_keystone_domain_facts.py @@ -111,7 +111,7 @@ def main(): # Let's suppose user is passing domain ID try: domains = opcloud.get_domain(name) - except: + except Exception: domains = opcloud.search_domains(filters={'name': name}) else: diff --git a/lib/ansible/modules/cloud/openstack/os_project.py b/lib/ansible/modules/cloud/openstack/os_project.py index a68becb0a6..9f197591f5 100644 --- a/lib/ansible/modules/cloud/openstack/os_project.py +++ b/lib/ansible/modules/cloud/openstack/os_project.py @@ -160,13 +160,13 @@ def main(): # We assume admin is passing domain id dom = cloud.get_domain(domain)['id'] domain = dom - except: + except Exception: # If we fail, maybe admin is passing a domain name. # Note that domains have unique names, just like id. try: dom = cloud.search_domains(filters={'name': domain})[0]['id'] domain = dom - except: + except Exception: # Ok, let's hope the user is non-admin and passing a sane id pass diff --git a/lib/ansible/modules/cloud/openstack/os_project_facts.py b/lib/ansible/modules/cloud/openstack/os_project_facts.py index 8b6b05d796..df476526e0 100644 --- a/lib/ansible/modules/cloud/openstack/os_project_facts.py +++ b/lib/ansible/modules/cloud/openstack/os_project_facts.py @@ -127,7 +127,7 @@ def main(): # We assume admin is passing domain id dom = opcloud.get_domain(domain)['id'] domain = dom - except: + except Exception: # If we fail, maybe admin is passing a domain name. # Note that domains have unique names, just like id. dom = opcloud.search_domains(filters={'name': domain}) diff --git a/lib/ansible/modules/cloud/openstack/os_user.py b/lib/ansible/modules/cloud/openstack/os_user.py index 2ddc8db181..7e2ca3e132 100644 --- a/lib/ansible/modules/cloud/openstack/os_user.py +++ b/lib/ansible/modules/cloud/openstack/os_user.py @@ -160,12 +160,12 @@ def _get_domain_id(cloud, domain): try: # We assume admin is passing domain id domain_id = cloud.get_domain(domain)['id'] - except: + except Exception: # If we fail, maybe admin is passing a domain name. # Note that domains have unique names, just like id. try: domain_id = cloud.search_domains(filters={'name': domain})[0]['id'] - except: + except Exception: # Ok, let's hope the user is non-admin and passing a sane id domain_id = domain diff --git a/lib/ansible/modules/cloud/openstack/os_user_facts.py b/lib/ansible/modules/cloud/openstack/os_user_facts.py index 422544a172..f8f0079030 100644 --- a/lib/ansible/modules/cloud/openstack/os_user_facts.py +++ b/lib/ansible/modules/cloud/openstack/os_user_facts.py @@ -135,7 +135,7 @@ def main(): # We assume admin is passing domain id dom = opcloud.get_domain(domain)['id'] domain = dom - except: + except Exception: # If we fail, maybe admin is passing a domain name. # Note that domains have unique names, just like id. dom = opcloud.search_domains(filters={'name': domain}) |