Merge "do_image_import: always pass remote_* to gc.images.image_import"

This commit is contained in:
Zuul 2023-07-04 18:50:19 +00:00 committed by Gerrit Code Review
commit 881f4e6343
2 changed files with 11 additions and 5 deletions

View File

@ -2279,7 +2279,9 @@ class ShellV2Test(testtools.TestCase):
test_shell.do_image_import(self.gc, args)
mock_import.assert_called_once_with(
'IMG-02', 'glance-direct', None, stores=None,
all_stores=None, allow_failure=True, backend=None)
all_stores=None, allow_failure=True,
remote_region=None, remote_image_id=None,
remote_service_interface=None, backend=None)
mocked_utils_print_image.assert_not_called()
@mock.patch('glanceclient.common.utils.print_image')

View File

@ -801,10 +801,14 @@ def do_image_import(gc, args):
if getattr(args, 'from_create', False):
# this command is being called "internally" so we can skip
# validation -- just do the import and get out of here
gc.images.image_import(args.id, args.import_method, args.uri,
backend=backend,
stores=stores, all_stores=all_stores,
allow_failure=allow_failure)
gc.images.image_import(
args.id, args.import_method, args.uri,
remote_region=remote_region,
remote_image_id=remote_image_id,
remote_service_interface=remote_service_interface,
backend=backend,
stores=stores, all_stores=all_stores,
allow_failure=allow_failure)
return
# do input validation