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