Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix missing exceptions #45775

Merged
merged 2 commits into from Oct 30, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/ansible/modules/cloud/openstack/os_quota.py
Expand Up @@ -249,12 +249,12 @@ def _get_quotas(sdk, module, cloud, project):
quota = {}
try:
quota['volume'] = _get_volume_quotas(cloud, project)
except sdk.exceptions.OpenStackCloudURINotFound:
except sdk.exceptions.NotFoundException:
module.warn("No public endpoint for volumev2 service was found. Ignoring volume quotas.")

try:
quota['network'] = _get_network_quotas(cloud, project)
except sdk.exceptions.OpenStackCloudURINotFound:
except sdk.exceptions.NotFoundException:
module.warn("No public endpoint for network service was found. Ignoring network quotas.")

quota['compute'] = _get_compute_quotas(cloud, project)
Expand Down
2 changes: 1 addition & 1 deletion lib/ansible/modules/cloud/openstack/os_server_volume.py
Expand Up @@ -139,7 +139,7 @@ def main():
result='Detached volume from server'
)

except (sdk.exceptions.OpenStackCloudException, sdk.exceptions.OpenStackCloudTimeout) as e:
except (sdk.exceptions.OpenStackCloudException, sdk.exceptions.ResourceTimeout) as e:
module.fail_json(msg=str(e))


Expand Down
2 changes: 1 addition & 1 deletion lib/ansible/modules/cloud/openstack/os_volume.py
Expand Up @@ -124,7 +124,7 @@ def _absent_volume(module, cloud, sdk):
changed = cloud.delete_volume(name_or_id=module.params['display_name'],
wait=module.params['wait'],
timeout=module.params['timeout'])
except sdk.exceptions.OpenStackCloudTimeout:
except sdk.exceptions.ResourceTimeout:
module.exit_json(changed=changed)

module.exit_json(changed=changed)
Expand Down
2 changes: 1 addition & 1 deletion lib/ansible/modules/cloud/openstack/os_volume_snapshot.py
Expand Up @@ -186,7 +186,7 @@ def main():
module.fail_json(
msg="No volume with name or id '{0}' was found.".format(
module.params['volume']))
except (sdk.exceptions.OpenStackCloudException, sdk.exceptions.OpenStackCloudTimeout) as e:
except (sdk.exceptions.OpenStackCloudException, sdk.exceptions.ResourceTimeout) as e:
module.fail_json(msg=e.message)


Expand Down