Merge "quota: Catch correct exception type for Compute quotas"
This commit is contained in:
commit
90148ffc45
@ -249,9 +249,14 @@ class ListQuota(command.Lister):
|
|||||||
for project_id in project_ids:
|
for project_id in project_ids:
|
||||||
try:
|
try:
|
||||||
project_data = compute_client.get_quota_set(project_id)
|
project_data = compute_client.get_quota_set(project_id)
|
||||||
|
# NOTE(stephenfin): Unfortunately, Nova raises a HTTP 400 (Bad
|
||||||
|
# Request) if the project ID is invalid, even though the project
|
||||||
|
# ID is actually the resource's identifier which would normally
|
||||||
|
# lead us to expect a HTTP 404 (Not Found).
|
||||||
except (
|
except (
|
||||||
sdk_exceptions.NotFoundException,
|
sdk_exceptions.BadRequestException,
|
||||||
sdk_exceptions.ForbiddenException,
|
sdk_exceptions.ForbiddenException,
|
||||||
|
sdk_exceptions.NotFoundException,
|
||||||
) as exc:
|
) as exc:
|
||||||
# Project not found, move on to next one
|
# Project not found, move on to next one
|
||||||
LOG.warning(f"Project {project_id} not found: {exc}")
|
LOG.warning(f"Project {project_id} not found: {exc}")
|
||||||
@ -312,8 +317,8 @@ class ListQuota(command.Lister):
|
|||||||
try:
|
try:
|
||||||
project_data = volume_client.get_quota_set(project_id)
|
project_data = volume_client.get_quota_set(project_id)
|
||||||
except (
|
except (
|
||||||
sdk_exceptions.NotFoundException,
|
|
||||||
sdk_exceptions.ForbiddenException,
|
sdk_exceptions.ForbiddenException,
|
||||||
|
sdk_exceptions.NotFoundException,
|
||||||
) as exc:
|
) as exc:
|
||||||
# Project not found, move on to next one
|
# Project not found, move on to next one
|
||||||
LOG.warning(f"Project {project_id} not found: {exc}")
|
LOG.warning(f"Project {project_id} not found: {exc}")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user