From a2d2e51ce83df88404df7b4240787b5e83e74a37 Mon Sep 17 00:00:00 2001 From: seankane-msft Date: Mon, 28 Jun 2021 16:26:36 -0400 Subject: [PATCH 1/5] patch --- .../azure-sdk-tools/devtools_testutils/storage_testcase.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/azure-sdk-tools/devtools_testutils/storage_testcase.py b/tools/azure-sdk-tools/devtools_testutils/storage_testcase.py index a67427dc5ecc..501ec743257f 100644 --- a/tools/azure-sdk-tools/devtools_testutils/storage_testcase.py +++ b/tools/azure-sdk-tools/devtools_testutils/storage_testcase.py @@ -14,8 +14,11 @@ pass from azure.mgmt.storage import StorageManagementClient -from azure.mgmt.storage.models import StorageAccount, Endpoints, BlobServiceProperties, DeleteRetentionPolicy, \ - LastAccessTimeTrackingPolicy +from azure.mgmt.storage.models import StorageAccount, Endpoints, BlobServiceProperties, DeleteRetentionPolicy +try: + from azure.mgmt.storage.models import LastAccessTimeTrackingPolicy +except ImportError: + pass from azure_devtools.scenario_tests.exceptions import AzureTestError From ddc8c0397a015c76bdfcc980b74c12599333ce47 Mon Sep 17 00:00:00 2001 From: seankane-msft Date: Mon, 28 Jun 2021 18:45:59 -0400 Subject: [PATCH 2/5] adding more to try/except --- tools/azure-sdk-tools/devtools_testutils/storage_testcase.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/azure-sdk-tools/devtools_testutils/storage_testcase.py b/tools/azure-sdk-tools/devtools_testutils/storage_testcase.py index 501ec743257f..0ac30133b3a9 100644 --- a/tools/azure-sdk-tools/devtools_testutils/storage_testcase.py +++ b/tools/azure-sdk-tools/devtools_testutils/storage_testcase.py @@ -14,9 +14,9 @@ pass from azure.mgmt.storage import StorageManagementClient -from azure.mgmt.storage.models import StorageAccount, Endpoints, BlobServiceProperties, DeleteRetentionPolicy +from azure.mgmt.storage.models import StorageAccount, Endpoints try: - from azure.mgmt.storage.models import LastAccessTimeTrackingPolicy + from azure.mgmt.storage.models import LastAccessTimeTrackingPolicy, BlobServiceProperties, DeleteRetentionPolicy except ImportError: pass From 9b8e1f9b3f8ac49c24cbb5b06540eec7589244de Mon Sep 17 00:00:00 2001 From: seankane-msft Date: Mon, 28 Jun 2021 18:46:29 -0400 Subject: [PATCH 3/5] note --- tools/azure-sdk-tools/devtools_testutils/storage_testcase.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/azure-sdk-tools/devtools_testutils/storage_testcase.py b/tools/azure-sdk-tools/devtools_testutils/storage_testcase.py index 0ac30133b3a9..3bb70e086044 100644 --- a/tools/azure-sdk-tools/devtools_testutils/storage_testcase.py +++ b/tools/azure-sdk-tools/devtools_testutils/storage_testcase.py @@ -16,6 +16,7 @@ from azure.mgmt.storage import StorageManagementClient from azure.mgmt.storage.models import StorageAccount, Endpoints try: + # Note: these models are only available from v17.0.0 and higher, if you need them you'll also need azure-core 1.4.0 and higher from azure.mgmt.storage.models import LastAccessTimeTrackingPolicy, BlobServiceProperties, DeleteRetentionPolicy except ImportError: pass From 0ec850df96bea2c92c2670f483079220b73de3b2 Mon Sep 17 00:00:00 2001 From: seankane-msft Date: Mon, 28 Jun 2021 19:09:59 -0400 Subject: [PATCH 4/5] have to import all in try/except --- tools/azure-sdk-tools/devtools_testutils/storage_testcase.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/azure-sdk-tools/devtools_testutils/storage_testcase.py b/tools/azure-sdk-tools/devtools_testutils/storage_testcase.py index 3bb70e086044..e7ced4286ce2 100644 --- a/tools/azure-sdk-tools/devtools_testutils/storage_testcase.py +++ b/tools/azure-sdk-tools/devtools_testutils/storage_testcase.py @@ -14,10 +14,9 @@ pass from azure.mgmt.storage import StorageManagementClient -from azure.mgmt.storage.models import StorageAccount, Endpoints try: # Note: these models are only available from v17.0.0 and higher, if you need them you'll also need azure-core 1.4.0 and higher - from azure.mgmt.storage.models import LastAccessTimeTrackingPolicy, BlobServiceProperties, DeleteRetentionPolicy + from azure.mgmt.storage.models import StorageAccount, Endpoints, LastAccessTimeTrackingPolicy, BlobServiceProperties, DeleteRetentionPolicy except ImportError: pass From 27d182b5f8556d03ee43058247542b70b0ffccb7 Mon Sep 17 00:00:00 2001 From: seankane-msft Date: Tue, 29 Jun 2021 10:30:37 -0400 Subject: [PATCH 5/5] adding storage client to try/except --- tools/azure-sdk-tools/devtools_testutils/storage_testcase.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/azure-sdk-tools/devtools_testutils/storage_testcase.py b/tools/azure-sdk-tools/devtools_testutils/storage_testcase.py index e7ced4286ce2..c3a9ebee87c3 100644 --- a/tools/azure-sdk-tools/devtools_testutils/storage_testcase.py +++ b/tools/azure-sdk-tools/devtools_testutils/storage_testcase.py @@ -13,9 +13,9 @@ except: pass -from azure.mgmt.storage import StorageManagementClient try: # Note: these models are only available from v17.0.0 and higher, if you need them you'll also need azure-core 1.4.0 and higher + from azure.mgmt.storage import StorageManagementClient from azure.mgmt.storage.models import StorageAccount, Endpoints, LastAccessTimeTrackingPolicy, BlobServiceProperties, DeleteRetentionPolicy except ImportError: pass