Fix get_compute_limits error message

We're currently using name_or_id in the error message whether it's there
or not.

Change-Id: Ieaddc57e52f7c26b410ebe0178e2c30f48897769
This commit is contained in:
Monty Taylor 2017-05-23 08:13:19 -05:00
parent 8d34399714
commit 12b07e12e2
No known key found for this signature in database
GPG Key ID: 7BAE94BC7141A594

View File

@ -1888,6 +1888,7 @@ class OpenStackCloud(
"""
kwargs = {}
project_id = None
error_msg = "Failed to get limits"
if name_or_id:
proj = self.get_project(name_or_id)
@ -1895,10 +1896,10 @@ class OpenStackCloud(
raise OpenStackCloudException("project does not exist")
project_id = proj.id
kwargs['tenant_id'] = project_id
error_msg = "{msg} for the project: {project} ".format(
msg=error_msg, project=name_or_id)
with _utils.shade_exceptions(
"Failed to get limits for the project: {} ".format(
name_or_id)):
with _utils.shade_exceptions(error_msg):
# TODO(mordred) Before we convert this to REST, we need to add
# in support for running calls with a different project context
limits = self.manager.submit_task(_tasks.NovaLimitsGet(**kwargs))