Bump dependency versions to avoid conflicts (#54443)

* Bump dependency versions to avoid conflicts

* Fix module code to support newer SDK packages

* Fix keyvault module are upgrading deps
pull/54741/head
Jordan Borean 6 years ago committed by GitHub
parent ea2fa07e23
commit 8b1b22ddc7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -67,7 +67,7 @@ AZURE_API_PROFILES = {
'NetworkManagementClient': '2018-08-01', 'NetworkManagementClient': '2018-08-01',
'ResourceManagementClient': '2017-05-10', 'ResourceManagementClient': '2017-05-10',
'StorageManagementClient': '2017-10-01', 'StorageManagementClient': '2017-10-01',
'WebsiteManagementClient': '2016-08-01', 'WebSiteManagementClient': '2018-02-01',
'PostgreSQLManagementClient': '2017-12-01', 'PostgreSQLManagementClient': '2017-12-01',
'MySQLManagementClient': '2017-12-01', 'MySQLManagementClient': '2017-12-01',
'MariaDBManagementClient': '2019-03-01' 'MariaDBManagementClient': '2019-03-01'
@ -235,7 +235,7 @@ AZURE_PKG_VERSIONS = {
}, },
'WebSiteManagementClient': { 'WebSiteManagementClient': {
'package_name': 'web', 'package_name': 'web',
'expected_version': '0.32.0' 'expected_version': '0.41.0'
}, },
'TrafficManagerManagementClient': { 'TrafficManagerManagementClient': {
'package_name': 'trafficmanager', 'package_name': 'trafficmanager',
@ -870,7 +870,7 @@ class AzureRMModuleBase(object):
if not self._web_client: if not self._web_client:
self._web_client = self.get_mgmt_svc_client(WebSiteManagementClient, self._web_client = self.get_mgmt_svc_client(WebSiteManagementClient,
base_url=self._cloud_environment.endpoints.resource_manager, base_url=self._cloud_environment.endpoints.resource_manager,
api_version='2016-08-01') api_version='2018-02-01')
return self._web_client return self._web_client
@property @property

@ -192,7 +192,8 @@ class AzureRMFunctionApp(AzureRMModuleBase):
resource_group_name=self.resource_group, resource_group_name=self.resource_group,
name=self.name name=self.name
) )
exists = True # Newer SDK versions (0.40.0+) seem to return None if it doesn't exist instead of raising CloudError
exists = function_app is not None
except CloudError as exc: except CloudError as exc:
exists = False exists = False

@ -190,8 +190,8 @@ from ansible.module_utils.azure_rm_common import AzureRMModuleBase
try: try:
from msrestazure.azure_exceptions import CloudError from msrestazure.azure_exceptions import CloudError
from msrestazure.azure_operation import AzureOperationPoller
from azure.mgmt.keyvault import KeyVaultManagementClient from azure.mgmt.keyvault import KeyVaultManagementClient
from msrest.polling import LROPoller
from msrest.serialization import Model from msrest.serialization import Model
except ImportError: except ImportError:
# This is handled in azure_rm_common # This is handled in azure_rm_common
@ -325,7 +325,8 @@ class AzureRMVaults(AzureRMModuleBase):
response = None response = None
self.mgmt_client = self.get_mgmt_svc_client(KeyVaultManagementClient, self.mgmt_client = self.get_mgmt_svc_client(KeyVaultManagementClient,
base_url=self._cloud_environment.endpoints.resource_manager) base_url=self._cloud_environment.endpoints.resource_manager,
api_version="2018-02-14")
resource_group = self.get_resource_group(self.resource_group) resource_group = self.get_resource_group(self.resource_group)
@ -448,7 +449,7 @@ class AzureRMVaults(AzureRMModuleBase):
response = self.mgmt_client.vaults.create_or_update(resource_group_name=self.resource_group, response = self.mgmt_client.vaults.create_or_update(resource_group_name=self.resource_group,
vault_name=self.vault_name, vault_name=self.vault_name,
parameters=self.parameters) parameters=self.parameters)
if isinstance(response, AzureOperationPoller): if isinstance(response, LROPoller):
response = self.get_poller_result(response) response = self.get_poller_result(response)
except CloudError as exc: except CloudError as exc:

@ -286,7 +286,7 @@ from ansible.module_utils.azure_rm_common import AzureRMModuleBase
try: try:
from msrestazure.azure_exceptions import CloudError from msrestazure.azure_exceptions import CloudError
from msrestazure.azure_operation import AzureOperationPoller from msrest.polling import LROPoller
from msrest.serialization import Model from msrest.serialization import Model
from azure.mgmt.web.models import ( from azure.mgmt.web.models import (
site_config, app_service_plan, Site, site_config, app_service_plan, Site,
@ -671,7 +671,7 @@ class AzureRMWebApps(AzureRMModuleBase):
if self.app_settings: if self.app_settings:
app_settings = [] app_settings = []
for key in self.app_settings.keys(): for key in self.app_settings.keys():
app_settings.append(NameValuePair(key, self.app_settings[key])) app_settings.append(NameValuePair(name=key, value=self.app_settings[key]))
self.site_config['app_settings'] = app_settings self.site_config['app_settings'] = app_settings
else: else:
@ -707,7 +707,7 @@ class AzureRMWebApps(AzureRMModuleBase):
# purge existing app_settings: # purge existing app_settings:
if self.purge_app_settings: if self.purge_app_settings:
to_be_updated = True to_be_updated = True
self.app_settings_strDic.properties = dict() self.app_settings_strDic = dict()
self.to_do.append(Actions.UpdateAppSettings) self.to_do.append(Actions.UpdateAppSettings)
# check if app settings changed # check if app settings changed
@ -717,7 +717,7 @@ class AzureRMWebApps(AzureRMModuleBase):
if self.app_settings: if self.app_settings:
for key in self.app_settings.keys(): for key in self.app_settings.keys():
self.app_settings_strDic.properties[key] = self.app_settings[key] self.app_settings_strDic[key] = self.app_settings[key]
elif self.state == 'absent': elif self.state == 'absent':
if old_response: if old_response:
@ -772,7 +772,8 @@ class AzureRMWebApps(AzureRMModuleBase):
# compare existing web app with input, determine weather it's update operation # compare existing web app with input, determine weather it's update operation
def is_updatable_property_changed(self, existing_webapp): def is_updatable_property_changed(self, existing_webapp):
for property_name in self.updatable_properties: for property_name in self.updatable_properties:
if hasattr(self, property_name) and getattr(self, property_name) != existing_webapp.get(property_name, None): if hasattr(self, property_name) and getattr(self, property_name) is not None and \
getattr(self, property_name) != existing_webapp.get(property_name, None):
return True return True
return False return False
@ -790,9 +791,9 @@ class AzureRMWebApps(AzureRMModuleBase):
# comparing existing app setting with input, determine whether it's changed # comparing existing app setting with input, determine whether it's changed
def is_app_settings_changed(self): def is_app_settings_changed(self):
if self.app_settings: if self.app_settings:
if self.app_settings_strDic.properties: if self.app_settings_strDic:
for key in self.app_settings.keys(): for key in self.app_settings.keys():
if self.app_settings[key] != self.app_settings_strDic.properties.get(key, None): if self.app_settings[key] != self.app_settings_strDic.get(key, None):
return True return True
else: else:
return True return True
@ -831,7 +832,7 @@ class AzureRMWebApps(AzureRMModuleBase):
skip_custom_domain_verification=self.skip_custom_domain_verification, skip_custom_domain_verification=self.skip_custom_domain_verification,
force_dns_registration=force_dns_registration, force_dns_registration=force_dns_registration,
ttl_in_seconds=self.ttl_in_seconds) ttl_in_seconds=self.ttl_in_seconds)
if isinstance(response, AzureOperationPoller): if isinstance(response, LROPoller):
response = self.get_poller_result(response) response = self.get_poller_result(response)
except CloudError as exc: except CloudError as exc:
@ -872,13 +873,17 @@ class AzureRMWebApps(AzureRMModuleBase):
response = self.web_client.web_apps.get(resource_group_name=self.resource_group, response = self.web_client.web_apps.get(resource_group_name=self.resource_group,
name=self.name) name=self.name)
self.log("Response : {0}".format(response)) # Newer SDK versions (0.40.0+) seem to return None if it doesn't exist instead of raising CloudError
self.log("Web App instance : {0} found".format(response.name)) if response is not None:
return webapp_to_dict(response) self.log("Response : {0}".format(response))
self.log("Web App instance : {0} found".format(response.name))
return webapp_to_dict(response)
except CloudError as ex: except CloudError as ex:
self.log("Didn't find web app {0} in resource group {1}".format( pass
self.name, self.resource_group))
self.log("Didn't find web app {0} in resource group {1}".format(
self.name, self.resource_group))
return False return False
@ -891,14 +896,20 @@ class AzureRMWebApps(AzureRMModuleBase):
try: try:
response = self.web_client.app_service_plans.get( response = self.web_client.app_service_plans.get(
self.plan['resource_group'], self.plan['name']) resource_group_name=self.plan['resource_group'],
self.log("Response : {0}".format(response)) name=self.plan['name'])
self.log("App Service Plan : {0} found".format(response.name))
return appserviceplan_to_dict(response) # Newer SDK versions (0.40.0+) seem to return None if it doesn't exist instead of raising CloudError
if response is not None:
self.log("Response : {0}".format(response))
self.log("App Service Plan : {0} found".format(response.name))
return appserviceplan_to_dict(response)
except CloudError as ex: except CloudError as ex:
self.log("Didn't find app service plan {0} in resource group {1}".format( pass
self.plan['name'], self.plan['resource_group']))
self.log("Didn't find app service plan {0} in resource group {1}".format(
self.plan['name'], self.plan['resource_group']))
return False return False
@ -921,7 +932,7 @@ class AzureRMWebApps(AzureRMModuleBase):
poller = self.web_client.app_service_plans.create_or_update( poller = self.web_client.app_service_plans.create_or_update(
self.plan['resource_group'], self.plan['name'], plan_def) self.plan['resource_group'], self.plan['name'], plan_def)
if isinstance(poller, AzureOperationPoller): if isinstance(poller, LROPoller):
response = self.get_poller_result(poller) response = self.get_poller_result(poller)
self.log("Response : {0}".format(response)) self.log("Response : {0}".format(response))
@ -944,7 +955,7 @@ class AzureRMWebApps(AzureRMModuleBase):
resource_group_name=self.resource_group, name=self.name) resource_group_name=self.resource_group, name=self.name)
self.log("Response : {0}".format(response)) self.log("Response : {0}".format(response))
return response return response.properties
except CloudError as ex: except CloudError as ex:
self.fail("Failed to list application settings for web app {0} in resource group {1}: {2}".format( self.fail("Failed to list application settings for web app {0} in resource group {1}: {2}".format(
self.name, self.resource_group, str(ex))) self.name, self.resource_group, str(ex)))
@ -958,7 +969,7 @@ class AzureRMWebApps(AzureRMModuleBase):
try: try:
response = self.web_client.web_apps.update_application_settings( response = self.web_client.web_apps.update_application_settings(
resource_group_name=self.resource_group, name=self.name, app_settings=self.app_settings_strDic) resource_group_name=self.resource_group, name=self.name, properties=self.app_settings_strDic)
self.log("Response : {0}".format(response)) self.log("Response : {0}".format(response))
return response return response

@ -149,7 +149,7 @@ webapps:
''' '''
try: try:
from msrestazure.azure_exceptions import CloudError from msrestazure.azure_exceptions import CloudError
from msrestazure.azure_operation import AzureOperationPoller from msrest.polling import LROPoller
from azure.common import AzureMissingResourceHttpError, AzureHttpError from azure.common import AzureMissingResourceHttpError, AzureHttpError
except Exception: except Exception:
# This is handled in azure_rm_common # This is handled in azure_rm_common
@ -277,7 +277,7 @@ class AzureRMWebAppFacts(AzureRMModuleBase):
self.log('Get web app {0} publish credentials'.format(name)) self.log('Get web app {0} publish credentials'.format(name))
try: try:
poller = self.web_client.web_apps.list_publishing_credentials(resource_group, name) poller = self.web_client.web_apps.list_publishing_credentials(resource_group, name)
if isinstance(poller, AzureOperationPoller): if isinstance(poller, LROPoller):
response = self.get_poller_result(poller) response = self.get_poller_result(poller)
except CloudError as ex: except CloudError as ex:
request_id = ex.request_id if ex.request_id else '' request_id = ex.request_id if ex.request_id else ''

@ -224,7 +224,7 @@ from ansible.module_utils.azure_rm_common import AzureRMModuleBase
try: try:
from msrestazure.azure_exceptions import CloudError from msrestazure.azure_exceptions import CloudError
from msrestazure.azure_operation import AzureOperationPoller from msrest.polling import LROPoller
from msrest.serialization import Model from msrest.serialization import Model
from azure.mgmt.web.models import ( from azure.mgmt.web.models import (
site_config, app_service_plan, Site, site_config, app_service_plan, Site,
@ -563,7 +563,7 @@ class AzureRMWebAppSlots(AzureRMModuleBase):
if self.app_settings: if self.app_settings:
app_settings = [] app_settings = []
for key in self.app_settings.keys(): for key in self.app_settings.keys():
app_settings.append(NameValuePair(key, self.app_settings[key])) app_settings.append(NameValuePair(name=key, value=self.app_settings[key]))
self.site_config['app_settings'] = app_settings self.site_config['app_settings'] = app_settings
@ -595,7 +595,7 @@ class AzureRMWebAppSlots(AzureRMModuleBase):
if self.purge_app_settings: if self.purge_app_settings:
to_be_updated = True to_be_updated = True
self.to_do = Actions.UpdateAppSettings self.to_do = Actions.UpdateAppSettings
self.app_settings_strDic.properties = dict() self.app_settings_strDic = dict()
# check if app settings changed # check if app settings changed
if self.purge_app_settings or self.is_app_settings_changed(): if self.purge_app_settings or self.is_app_settings_changed():
@ -604,7 +604,7 @@ class AzureRMWebAppSlots(AzureRMModuleBase):
if self.app_settings: if self.app_settings:
for key in self.app_settings.keys(): for key in self.app_settings.keys():
self.app_settings_strDic.properties[key] = self.app_settings[key] self.app_settings_strDic[key] = self.app_settings[key]
elif self.state == 'absent': elif self.state == 'absent':
if old_response: if old_response:
@ -682,10 +682,10 @@ class AzureRMWebAppSlots(AzureRMModuleBase):
# comparing existing app setting with input, determine whether it's changed # comparing existing app setting with input, determine whether it's changed
def is_app_settings_changed(self): def is_app_settings_changed(self):
if self.app_settings: if self.app_settings:
if len(self.app_settings_strDic.properties) != len(self.app_settings): if len(self.app_settings_strDic) != len(self.app_settings):
return True return True
if self.app_settings_strDic.properties != self.app_settings: if self.app_settings_strDic != self.app_settings:
return True return True
return False return False
@ -716,7 +716,7 @@ class AzureRMWebAppSlots(AzureRMModuleBase):
slot=self.name, slot=self.name,
name=self.webapp_name, name=self.webapp_name,
site_envelope=self.site) site_envelope=self.site)
if isinstance(response, AzureOperationPoller): if isinstance(response, LROPoller):
response = self.get_poller_result(response) response = self.get_poller_result(response)
except CloudError as exc: except CloudError as exc:
@ -757,13 +757,17 @@ class AzureRMWebAppSlots(AzureRMModuleBase):
response = self.web_client.web_apps.get(resource_group_name=self.resource_group, response = self.web_client.web_apps.get(resource_group_name=self.resource_group,
name=self.webapp_name) name=self.webapp_name)
self.log("Response : {0}".format(response)) # Newer SDK versions (0.40.0+) seem to return None if it doesn't exist instead of raising CloudError
self.log("Web App instance : {0} found".format(response.name)) if response is not None:
return webapp_to_dict(response) self.log("Response : {0}".format(response))
self.log("Web App instance : {0} found".format(response.name))
return webapp_to_dict(response)
except CloudError as ex: except CloudError as ex:
self.log("Didn't find web app {0} in resource group {1}".format( pass
self.webapp_name, self.resource_group))
self.log("Didn't find web app {0} in resource group {1}".format(
self.webapp_name, self.resource_group))
return False return False
@ -783,12 +787,16 @@ class AzureRMWebAppSlots(AzureRMModuleBase):
name=self.webapp_name, name=self.webapp_name,
slot=self.name) slot=self.name)
self.log("Response : {0}".format(response)) # Newer SDK versions (0.40.0+) seem to return None if it doesn't exist instead of raising CloudError
self.log("Web App slot: {0} found".format(response.name)) if response is not None:
return slot_to_dict(response) self.log("Response : {0}".format(response))
self.log("Web App slot: {0} found".format(response.name))
return slot_to_dict(response)
except CloudError as ex: except CloudError as ex:
self.log("Does not find web app slot {0} in resource group {1}".format(self.name, self.resource_group)) pass
self.log("Does not find web app slot {0} in resource group {1}".format(self.name, self.resource_group))
return False return False
@ -805,7 +813,7 @@ class AzureRMWebAppSlots(AzureRMModuleBase):
resource_group_name=self.resource_group, name=self.webapp_name) resource_group_name=self.resource_group, name=self.webapp_name)
self.log("Response : {0}".format(response)) self.log("Response : {0}".format(response))
return response return response.properties
except CloudError as ex: except CloudError as ex:
self.fail("Failed to list application settings for web app {0} in resource group {1}: {2}".format( self.fail("Failed to list application settings for web app {0} in resource group {1}: {2}".format(
self.name, self.resource_group, str(ex))) self.name, self.resource_group, str(ex)))
@ -823,7 +831,7 @@ class AzureRMWebAppSlots(AzureRMModuleBase):
resource_group_name=self.resource_group, name=self.webapp_name, slot=slot_name) resource_group_name=self.resource_group, name=self.webapp_name, slot=slot_name)
self.log("Response : {0}".format(response)) self.log("Response : {0}".format(response))
return response return response.properties
except CloudError as ex: except CloudError as ex:
self.fail("Failed to list application settings for web app slot {0} in resource group {1}: {2}".format( self.fail("Failed to list application settings for web app slot {0} in resource group {1}: {2}".format(
self.name, self.resource_group, str(ex))) self.name, self.resource_group, str(ex)))
@ -844,7 +852,7 @@ class AzureRMWebAppSlots(AzureRMModuleBase):
name=self.webapp_name, name=self.webapp_name,
slot=slot_name, slot=slot_name,
kind=None, kind=None,
app_settings=app_settings) properties=app_settings)
self.log("Response : {0}".format(response)) self.log("Response : {0}".format(response))
return response.as_dict() return response.as_dict()
@ -1028,7 +1036,7 @@ class AzureRMWebAppSlots(AzureRMModuleBase):
app_setting_clone_from = self.list_app_settings_slot(src_slot) app_setting_clone_from = self.list_app_settings_slot(src_slot)
if self.app_settings: if self.app_settings:
app_setting_clone_from.properties.update(self.app_settings) app_setting_clone_from.update(self.app_settings)
self.update_app_settings_slot(app_settings=app_setting_clone_from) self.update_app_settings_slot(app_settings=app_setting_clone_from)

@ -4,14 +4,14 @@ azure-cli-core==2.0.35
azure-cli-nspkg==3.0.2 azure-cli-nspkg==3.0.2
azure-common==1.1.11 azure-common==1.1.11
azure-mgmt-authorization==0.51.1 azure-mgmt-authorization==0.51.1
azure-mgmt-batch==4.1.0 azure-mgmt-batch==5.0.1
azure-mgmt-cdn==3.0.0 azure-mgmt-cdn==3.0.0
azure-mgmt-compute==4.4.0 azure-mgmt-compute==4.4.0
azure-mgmt-containerinstance==1.4.0 azure-mgmt-containerinstance==1.4.0
azure-mgmt-containerregistry==2.0.0 azure-mgmt-containerregistry==2.0.0
azure-mgmt-containerservice==4.4.0 azure-mgmt-containerservice==4.4.0
azure-mgmt-dns==2.1.0 azure-mgmt-dns==2.1.0
azure-mgmt-keyvault==0.40.0 azure-mgmt-keyvault==1.1.0
azure-mgmt-marketplaceordering==0.1.0 azure-mgmt-marketplaceordering==0.1.0
azure-mgmt-monitor==0.5.2 azure-mgmt-monitor==0.5.2
azure-mgmt-network==2.3.0 azure-mgmt-network==2.3.0
@ -23,7 +23,7 @@ azure-mgmt-servicebus==0.5.3
azure-mgmt-sql==0.10.0 azure-mgmt-sql==0.10.0
azure-mgmt-storage==3.1.0 azure-mgmt-storage==3.1.0
azure-mgmt-trafficmanager==0.50.0 azure-mgmt-trafficmanager==0.50.0
azure-mgmt-web==0.32.0 azure-mgmt-web==0.41.0
azure-nspkg==2.0.0 azure-nspkg==2.0.0
azure-storage==0.35.1 azure-storage==0.35.1
msrest==0.6.1 msrest==0.6.1

@ -4,14 +4,14 @@ azure-cli-core==2.0.35
azure-cli-nspkg==3.0.2 azure-cli-nspkg==3.0.2
azure-common==1.1.11 azure-common==1.1.11
azure-mgmt-authorization==0.51.1 azure-mgmt-authorization==0.51.1
azure-mgmt-batch==4.1.0 azure-mgmt-batch==5.0.1
azure-mgmt-cdn==3.0.0 azure-mgmt-cdn==3.0.0
azure-mgmt-compute==4.4.0 azure-mgmt-compute==4.4.0
azure-mgmt-containerinstance==1.4.0 azure-mgmt-containerinstance==1.4.0
azure-mgmt-containerregistry==2.0.0 azure-mgmt-containerregistry==2.0.0
azure-mgmt-containerservice==4.4.0 azure-mgmt-containerservice==4.4.0
azure-mgmt-dns==2.1.0 azure-mgmt-dns==2.1.0
azure-mgmt-keyvault==0.40.0 azure-mgmt-keyvault==1.1.0
azure-mgmt-marketplaceordering==0.1.0 azure-mgmt-marketplaceordering==0.1.0
azure-mgmt-monitor==0.5.2 azure-mgmt-monitor==0.5.2
azure-mgmt-network==2.3.0 azure-mgmt-network==2.3.0
@ -23,7 +23,7 @@ azure-mgmt-servicebus==0.5.3
azure-mgmt-sql==0.10.0 azure-mgmt-sql==0.10.0
azure-mgmt-storage==3.1.0 azure-mgmt-storage==3.1.0
azure-mgmt-trafficmanager==0.50.0 azure-mgmt-trafficmanager==0.50.0
azure-mgmt-web==0.32.0 azure-mgmt-web==0.41.0
azure-nspkg==2.0.0 azure-nspkg==2.0.0
azure-storage==0.35.1 azure-storage==0.35.1
msrest==0.6.1 msrest==0.6.1

Loading…
Cancel
Save