Browse Source

Merge "Don't look up project by id if given id"

changes/25/674325/16 5.2.0
Zuul 1 year ago
committed by Gerrit Code Review
parent
commit
c5719a12b5
1 changed files with 8 additions and 3 deletions
  1. +8
    -3
      openstackclient/image/v2/image.py

+ 8
- 3
openstackclient/image/v2/image.py View File

@ -21,6 +21,7 @@ import logging
import os
import sys
import openstack.cloud._utils
from openstack.image import image_signer
from osc_lib.api import utils as api_utils
from osc_lib.cli import format_columns
@ -158,9 +159,13 @@ class AddProjectToImage(command.ShowOne):
image_client = self.app.client_manager.image
identity_client = self.app.client_manager.identity
project_id = common.find_project(identity_client,
parsed_args.project,
parsed_args.project_domain).id
if openstack.cloud._utils._is_uuid_like(parsed_args.project):
project_id = parsed_args.project
else:
project_id = common.find_project(
identity_client,
parsed_args.project,
parsed_args.project_domain).id
image = image_client.find_image(parsed_args.image,
ignore_missing=False)


Loading…
Cancel
Save