diff --git a/src/image-copy/azext_imagecopy/create_target.py b/src/image-copy/azext_imagecopy/create_target.py index faf38590940..8283d3be731 100644 --- a/src/image-copy/azext_imagecopy/create_target.py +++ b/src/image-copy/azext_imagecopy/create_target.py @@ -5,10 +5,12 @@ import datetime import time -from azext_imagecopy.cli_utils import run_cli_command, prepare_cli_command -from knack.util import CLIError +from knack.util import CLIError from knack.log import get_logger + +from azext_imagecopy.cli_utils import run_cli_command, prepare_cli_command + logger = get_logger(__name__) STORAGE_ACCOUNT_NAME_LENGTH = 24 diff --git a/src/image-copy/azext_imagecopy/custom.py b/src/image-copy/azext_imagecopy/custom.py index cb1f85c77f3..4abdf700a96 100644 --- a/src/image-copy/azext_imagecopy/custom.py +++ b/src/image-copy/azext_imagecopy/custom.py @@ -5,19 +5,20 @@ from multiprocessing import Pool +from knack.util import CLIError +from knack.log import get_logger + from azext_imagecopy.cli_utils import run_cli_command, prepare_cli_command from azext_imagecopy.create_target import create_target_image -from knack.util import CLIError -from knack.log import get_logger logger = get_logger(__name__) # pylint: disable=too-many-statements # pylint: disable=too-many-locals def imagecopy(source_resource_group_name, source_object_name, target_location, - target_resource_group_name, temporary_resource_group_name, source_type='image', - cleanup='false', parallel_degree=-1, tags=None, target_name=None, + target_resource_group_name, temporary_resource_group_name='image-copy-rg', + source_type='image', cleanup='false', parallel_degree=-1, tags=None, target_name=None, target_subscription=None, export_as_snapshot='false', timeout=3600): # get the os disk id from source vm/image @@ -82,10 +83,10 @@ def imagecopy(source_resource_group_name, source_object_name, target_location, # Get SAS URL for the snapshotName logger.warn( - "Getting sas url for the source snapshot with timeout seconds: %d", timeout) + "Getting sas url for the source snapshot with timeout: %d seconds", timeout) if timeout < 3600: - logger.warn("Timeout should be greater than 3600") - raise CLIError('Inavlid Timeout') + logger.error("Timeout should be greater than 3600 seconds") + raise CLIError('Invalid Timeout') cli_cmd = prepare_cli_command(['snapshot', 'grant-access', '--name', source_os_disk_snapshot_name, diff --git a/src/image-copy/setup.py b/src/image-copy/setup.py index 12ccce4a71c..735dbc25cbf 100644 --- a/src/image-copy/setup.py +++ b/src/image-copy/setup.py @@ -8,7 +8,7 @@ from codecs import open from setuptools import setup, find_packages -VERSION = "0.0.9" +VERSION = "0.2.1" CLASSIFIERS = [ 'Development Status :: 4 - Beta', diff --git a/src/index.json b/src/index.json index 18c5792e4d7..14cf714a280 100644 --- a/src/index.json +++ b/src/index.json @@ -1240,8 +1240,8 @@ ], "image-copy-extension": [ { - "downloadUrl": "https://files.pythonhosted.org/packages/0b/3a/c8e02e8af6941fe55ed55d6011c15a60ba8ce3ddd52a34ae7c2c5043958f/image_copy_extension-0.0.9-py2.py3-none-any.whl", - "filename": "image_copy_extension-0.0.9-py2.py3-none-any.whl", + "downloadUrl": "https://files.pythonhosted.org/packages/d9/45/3d5b20c461392a84268a7b655ee32c98338daadc060060efeffd7ef3d76f/image_copy_extension-0.2.1-py2.py3-none-any.whl", + "filename": "image_copy_extension-0.2.1-py2.py3-none-any.whl", "metadata": { "azext.minCliCoreVersion": "2.0.24", "classifiers": [ @@ -1279,9 +1279,9 @@ "metadata_version": "2.0", "name": "image-copy-extension", "summary": "Support for copying managed vm images between regions", - "version": "0.0.9" + "version": "0.2.1" }, - "sha256Digest": "7f77f6c2ba940fb64ff157555ee26cc688bd4b5f8b3b5b3fef738158a16ac7b1" + "sha256Digest": "1d9eab829c63e601fa93e616cc4e5d73946fa225aa8e5ffd84a98d11cdc4138b" } ], "interactive": [