diff --git a/src/image-copy/HISTORY.rst b/src/image-copy/HISTORY.rst index 885ce98091a..90f678c9418 100644 --- a/src/image-copy/HISTORY.rst +++ b/src/image-copy/HISTORY.rst @@ -3,6 +3,10 @@ Release History =============== +1.0.3 +++++++ +* Fix the issue for sasTokenParsing, removing python related warnings from the sasToken(cmd_output was unfiltered) + 1.0.2 ++++++ * Create temporary storage account with minimum TLS version set to `TLS1_2` diff --git a/src/image-copy/azext_imagecopy/create_target.py b/src/image-copy/azext_imagecopy/create_target.py index 2001fcbd834..62273a69757 100644 --- a/src/image-copy/azext_imagecopy/create_target.py +++ b/src/image-copy/azext_imagecopy/create_target.py @@ -6,10 +6,10 @@ import datetime import time -from knack.util import CLIError +from azext_imagecopy.cli_utils import (get_storage_account_id_from_blob_path, + prepare_cli_command, run_cli_command) from knack.log import get_logger - -from azext_imagecopy.cli_utils import run_cli_command, prepare_cli_command, get_storage_account_id_from_blob_path +from knack.util import CLIError logger = get_logger(__name__) @@ -73,6 +73,10 @@ def create_target_image(location, transient_resource_group_name, source_type, so sas_token = run_cli_command(cli_cmd) sas_token = sas_token.rstrip("\n\r") # STRANGE + # Remove python related warnings from the SAS token if there are warning included in the SAS token + if len(sas_token.split()) > 1: + sas_token = sas_token.split()[-1] + logger.debug("sas token: %s", sas_token) # create a container in the target blob storage account @@ -206,7 +210,7 @@ def wait_for_blob_copy_operation(blob_name, target_container_name, target_storag def get_random_string(length): - import string import random + import string chars = string.ascii_lowercase + string.digits return ''.join(random.choice(chars) for _ in range(length)) diff --git a/src/image-copy/setup.py b/src/image-copy/setup.py index a203df00938..7f9d39e1aa3 100644 --- a/src/image-copy/setup.py +++ b/src/image-copy/setup.py @@ -6,9 +6,9 @@ # -------------------------------------------------------------------------------------------- from codecs import open -from setuptools import setup, find_packages +from setuptools import find_packages, setup -VERSION = "1.0.2" +VERSION = "1.0.3" CLASSIFIERS = [ 'Development Status :: 4 - Beta',