SHA256
1
0
forked from pool/salt
salt/loosen-azure-sdk-dependencies-in-azurearm-cloud-driv.patch

43 lines
1.2 KiB
Diff

From 6381be1a6e6d863f85dd33c82b9b949b552a7e49 Mon Sep 17 00:00:00 2001
From: Joachim Gleissner <jgleissner@suse.com>
Date: Tue, 18 Sep 2018 15:07:13 +0200
Subject: [PATCH] loosen azure sdk dependencies in azurearm cloud
driver
Remove dependency to azure-cli, which is not used at all.
Use azure-storage-sdk as fallback if multiapi version is not available.
remove unused import from azurearm driver
---
salt/cloud/clouds/azurearm.py | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/salt/cloud/clouds/azurearm.py b/salt/cloud/clouds/azurearm.py
index 8b9254cecb..0e92a56156 100644
--- a/salt/cloud/clouds/azurearm.py
+++ b/salt/cloud/clouds/azurearm.py
@@ -98,6 +98,7 @@ import importlib
import logging
import os
import os.path
+import pkgutil
import pprint
import string
import time
@@ -129,6 +130,11 @@ try:
from azure.storage.blob.blockblobservice import BlockBlobService
from msrestazure.azure_exceptions import CloudError
+ if pkgutil.find_loader("azure.multiapi"):
+ # use multiapi version if available
+ from azure.multiapi.storage.v2016_05_31 import CloudStorageAccount
+ else:
+ from azure.storage import CloudStorageAccount
HAS_LIBS = True
except ImportError:
pass
--
2.29.2