Add support for Azure 2.0.0 (#27920)

* Adapt azure_rm_resource_group to azure 2.0.0 + azure Cli support

* Fix exceptions in Azure ARM plugins

* update azure_rm_networkinterface documention to reflect required params

* change state param to not required for docs in azure_rm_subnet

* fix import to reflect azure==2.0.0 changes

* add aliases and fix docs for azure_rm_storageblob

* add resource_group_name alias to azure_rm_storageaccount_facts

* fix import bug due to change in azure==2.0.0

* fix args bug and enum modules issue

* update docs to reflect azure==2.0.0

* pin management clients to a specific api_version

* update docs to reflect the new azure-ansible-base python package

* add fallback for older api resource group listing

* rework azure dependencies installation

* refactor path joining to a cross-plat solution
This commit is contained in:
Thomas Stringer 2017-08-11 11:22:02 -04:00 committed by Matt Davis
parent 1b9d9376e2
commit e4cd899363
17 changed files with 151 additions and 51 deletions

View file

@ -328,11 +328,12 @@ state:
try:
from msrestazure.azure_exceptions import CloudError
from azure.common import AzureHttpError
from azure.mgmt.network.models import NetworkSecurityGroup, SecurityRule
from azure.mgmt.network.models.network_management_client_enums import (SecurityRuleAccess,
SecurityRuleDirection,
SecurityRuleProtocol)
from azure.mgmt.network.models import (
SecurityRuleAccess,
SecurityRuleDirection,
SecurityRuleProtocol
)
except ImportError:
# This is handled in azure_rm_common
pass
@ -694,7 +695,7 @@ class AzureRMSecurityGroup(AzureRMModuleBase):
self.name,
parameters)
result = self.get_poller_result(poller)
except AzureHttpError as exc:
except CloudError as exc:
self.fail("Error creating/updating security group {0} - {1}".format(self.name, str(exc)))
return create_network_security_group_dict(result)
@ -702,7 +703,7 @@ class AzureRMSecurityGroup(AzureRMModuleBase):
try:
poller = self.network_client.network_security_groups.delete(self.resource_group, self.name)
result = self.get_poller_result(poller)
except AzureHttpError as exc:
except CloudError as exc:
raise Exception("Error deleting security group {0} - {1}".format(self.name, str(exc)))
return result