pin api version of azure storage models

This commit is contained in:
Zhijun Zhao 2017-12-25 15:58:26 +08:00 committed by Matt Davis
parent 6f8d3ad70d
commit c6531ad556
2 changed files with 9 additions and 6 deletions

View file

@ -753,6 +753,11 @@ class AzureRMModuleBase(object):
api_version='2017-10-01')
return self._storage_client
@property
def storage_accounts_models(self):
self.log('Getting storage models...')
return self.storage_client.storage_accounts.models
@property
def network_client(self):
self.log('Getting network client')

View file

@ -606,8 +606,6 @@ try:
DiskCreateOptionTypes, Plan, SubResource
from azure.mgmt.network.models import PublicIPAddress, NetworkSecurityGroup, NetworkInterface, \
NetworkInterfaceIPConfiguration, Subnet
from azure.mgmt.storage.models import StorageAccountCreateParameters, Sku
from azure.mgmt.storage.models import Kind, SkuTier, SkuName
except ImportError:
# This is handled in azure_rm_common
pass
@ -1530,10 +1528,10 @@ class AzureRMVirtualMachine(AzureRMModuleBase):
self.log("Storage account {0} found.".format(storage_account_name))
self.check_provisioning_state(account)
return account
sku = Sku(SkuName.standard_lrs)
Sku.tier = SkuTier.standard
kind = Kind.storage
parameters = StorageAccountCreateParameters(sku, kind, self.location)
sku = self.storage_accounts_models.Sku(self.storage_accounts_models.SkuName.standard_lrs)
sku.tier = self.storage_accounts_models.SkuTier.standard
kind = self.storage_accounts_models.Kind.storage
parameters = self.storage_accounts_models.StorageAccountCreateParameters(sku, kind, self.location)
self.log("Creating storage account {0} in location {1}".format(storage_account_name, self.location))
self.results['actions'].append("Created storage account {0}".format(storage_account_name))
try: