Skip to content

Commit 85254fb

Browse files
committed
Revert "Don't look up project by id if given id"
This reverts commit 042be7c. This solution worked but it was confusing. The issue that the author was seeing was presumably due to users not being able to list projects but in theory the 'openstackclient.image.common.find_project' function that was being called here should have already handle this. It transpires however that there was a bug in this and we weren't correctly handling HTTP 403 errors correctly. This bug has since been fixed in change I2ea2def607ec5be112e42d53a1e660fef0cdd69c meaning this change is no longer necessary. Remove it and simplify the code somewhat. Change-Id: I108efec2c8deda50fcb9cc84f313602bed2ac15c Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
1 parent 6cd72f6 commit 85254fb

1 file changed

Lines changed: 5 additions & 9 deletions

File tree

openstackclient/image/v2/image.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
from osc_lib.command import command
3030
from osc_lib import exceptions
3131
from osc_lib import utils
32-
from oslo_utils import uuidutils
3332

3433
from openstackclient.common import progressbar
3534
from openstackclient.i18n import _
@@ -184,14 +183,11 @@ def take_action(self, parsed_args):
184183
image_client = self.app.client_manager.image
185184
identity_client = self.app.client_manager.identity
186185

187-
if uuidutils.is_uuid_like(parsed_args.project):
188-
project_id = parsed_args.project
189-
else:
190-
project_id = common.find_project(
191-
identity_client,
192-
parsed_args.project,
193-
parsed_args.project_domain,
194-
).id
186+
project_id = common.find_project(
187+
identity_client,
188+
parsed_args.project,
189+
parsed_args.project_domain,
190+
).id
195191

196192
image = image_client.find_image(
197193
parsed_args.image, ignore_missing=False

0 commit comments

Comments
 (0)