|
33 | 33 |
|
34 | 34 | from openstackclient.common import progressbar |
35 | 35 | from openstackclient.i18n import _ |
36 | | -from openstackclient.identity import common |
| 36 | +from openstackclient.identity import common as identity_common |
37 | 37 |
|
38 | 38 | if os.name == "nt": |
39 | 39 | import msvcrt |
@@ -177,14 +177,14 @@ def get_parser(self, prog_name): |
177 | 177 | metavar="<project>", |
178 | 178 | help=_("Project to associate with image (ID)"), |
179 | 179 | ) |
180 | | - common.add_project_domain_option_to_parser(parser) |
| 180 | + identity_common.add_project_domain_option_to_parser(parser) |
181 | 181 | return parser |
182 | 182 |
|
183 | 183 | def take_action(self, parsed_args): |
184 | 184 | image_client = self.app.client_manager.image |
185 | 185 | identity_client = self.app.client_manager.identity |
186 | 186 |
|
187 | | - project_id = common.find_project( |
| 187 | + project_id = identity_common.find_project( |
188 | 188 | identity_client, |
189 | 189 | parsed_args.project, |
190 | 190 | parsed_args.project_domain, |
@@ -397,7 +397,7 @@ def get_parser(self, prog_name): |
397 | 397 | "Force the use of glance image import instead of direct upload" |
398 | 398 | ), |
399 | 399 | ) |
400 | | - common.add_project_domain_option_to_parser(parser) |
| 400 | + identity_common.add_project_domain_option_to_parser(parser) |
401 | 401 | for deadopt in self.deadopts: |
402 | 402 | parser.add_argument( |
403 | 403 | "--%s" % deadopt, |
@@ -450,7 +450,7 @@ def _take_action_image(self, parsed_args): |
450 | 450 | kwargs['visibility'] = parsed_args.visibility |
451 | 451 |
|
452 | 452 | if parsed_args.project: |
453 | | - kwargs['owner_id'] = common.find_project( |
| 453 | + kwargs['owner_id'] = identity_common.find_project( |
454 | 454 | identity_client, |
455 | 455 | parsed_args.project, |
456 | 456 | parsed_args.project_domain, |
@@ -765,7 +765,7 @@ def get_parser(self, prog_name): |
765 | 765 | metavar='<project>', |
766 | 766 | help=_("Search by project (admin only) (name or ID)"), |
767 | 767 | ) |
768 | | - common.add_project_domain_option_to_parser(parser) |
| 768 | + identity_common.add_project_domain_option_to_parser(parser) |
769 | 769 | parser.add_argument( |
770 | 770 | '--tag', |
771 | 771 | metavar='<tag>', |
@@ -846,7 +846,7 @@ def take_action(self, parsed_args): |
846 | 846 | kwargs['tag'] = parsed_args.tag |
847 | 847 | project_id = None |
848 | 848 | if parsed_args.project: |
849 | | - project_id = common.find_project( |
| 849 | + project_id = identity_common.find_project( |
850 | 850 | identity_client, |
851 | 851 | parsed_args.project, |
852 | 852 | parsed_args.project_domain, |
@@ -925,7 +925,7 @@ def get_parser(self, prog_name): |
925 | 925 | metavar="<image>", |
926 | 926 | help=_("Image (name or ID)"), |
927 | 927 | ) |
928 | | - common.add_project_domain_option_to_parser(parser) |
| 928 | + identity_common.add_project_domain_option_to_parser(parser) |
929 | 929 | return parser |
930 | 930 |
|
931 | 931 | def take_action(self, parsed_args): |
@@ -963,15 +963,17 @@ def get_parser(self, prog_name): |
963 | 963 | metavar="<project>", |
964 | 964 | help=_("Project to disassociate with image (name or ID)"), |
965 | 965 | ) |
966 | | - common.add_project_domain_option_to_parser(parser) |
| 966 | + identity_common.add_project_domain_option_to_parser(parser) |
967 | 967 | return parser |
968 | 968 |
|
969 | 969 | def take_action(self, parsed_args): |
970 | 970 | image_client = self.app.client_manager.image |
971 | 971 | identity_client = self.app.client_manager.identity |
972 | 972 |
|
973 | | - project_id = common.find_project( |
974 | | - identity_client, parsed_args.project, parsed_args.project_domain |
| 973 | + project_id = identity_common.find_project( |
| 974 | + identity_client, |
| 975 | + parsed_args.project, |
| 976 | + parsed_args.project_domain, |
975 | 977 | ).id |
976 | 978 |
|
977 | 979 | image = image_client.find_image( |
@@ -1176,7 +1178,7 @@ def get_parser(self, prog_name): |
1176 | 1178 | metavar="<project>", |
1177 | 1179 | help=_("Set an alternate project on this image (name or ID)"), |
1178 | 1180 | ) |
1179 | | - common.add_project_domain_option_to_parser(parser) |
| 1181 | + identity_common.add_project_domain_option_to_parser(parser) |
1180 | 1182 | for deadopt in self.deadopts: |
1181 | 1183 | parser.add_argument( |
1182 | 1184 | "--%s" % deadopt, |
@@ -1248,7 +1250,7 @@ def take_action(self, parsed_args): |
1248 | 1250 | ) |
1249 | 1251 | project_id = None |
1250 | 1252 | if parsed_args.project: |
1251 | | - project_id = common.find_project( |
| 1253 | + project_id = identity_common.find_project( |
1252 | 1254 | identity_client, |
1253 | 1255 | parsed_args.project, |
1254 | 1256 | parsed_args.project_domain, |
|
0 commit comments