mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
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.
This commit is contained in:
parent
e636dacc35
commit
bad28b65cd
@ -60,6 +60,7 @@ import logging
|
||||
import pprint
|
||||
import base64
|
||||
import collections
|
||||
import pkgutil
|
||||
import salt.cache
|
||||
import salt.config as config
|
||||
import salt.utils.cloud
|
||||
@ -117,9 +118,12 @@ try:
|
||||
from azure.mgmt.storage import StorageManagementClient
|
||||
from azure.mgmt.web import WebSiteManagementClient
|
||||
from msrestazure.azure_exceptions import CloudError
|
||||
from azure.multiapi.storage.v2016_05_31 import CloudStorageAccount
|
||||
from azure.cli import core
|
||||
HAS_LIBS = LooseVersion(core.__version__) >= LooseVersion("2.0.12")
|
||||
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
|
||||
# pylint: enable=wrong-import-position,wrong-import-order
|
||||
@ -152,8 +156,7 @@ def __virtual__():
|
||||
False,
|
||||
'The following dependencies are required to use the AzureARM driver: '
|
||||
'Microsoft Azure SDK for Python >= 2.0rc5, '
|
||||
'Microsoft Azure Storage SDK for Python >= 0.32, '
|
||||
'Microsoft Azure CLI >= 2.0.12'
|
||||
'Microsoft Azure Storage SDK for Python >= 0.32'
|
||||
)
|
||||
|
||||
global cache # pylint: disable=global-statement,invalid-name
|
||||
|
Loading…
Reference in New Issue
Block a user