Broken dependencies in 2.5 (#41952)

* essential fixes in 2.5

* one more fix

* disable try to see whats the problem

* fix indent

* try to fix msrest version

* fixed test

* undo try-except commenting out

* updated tests
pull/45243/head
Zim Kalinowski 6 years ago committed by Matt Davis
parent 6321e70232
commit 019c28bc3b

@ -839,6 +839,9 @@ class AzureRMModuleBase(object):
profile_default_version = api_profile_dict.get('default_api_version', None) profile_default_version = api_profile_dict.get('default_api_version', None)
if api_version or profile_default_version: if api_version or profile_default_version:
client_kwargs['api_version'] = api_version or profile_default_version client_kwargs['api_version'] = api_version or profile_default_version
if 'profile' in client_kwargs:
# remove profile; only pass API version if specified
client_kwargs.pop('profile')
client = client_type(**client_kwargs) client = client_type(**client_kwargs)

@ -50,7 +50,7 @@ options:
choices: choices:
- public - public
- none - none
default: None default: 'none'
ports: ports:
description: description:
- List of ports exposed within the container group. - List of ports exposed within the container group.
@ -93,7 +93,7 @@ options:
description: description:
- Force update of existing container instance. Any update will result in deletion and recreation of existing containers. - Force update of existing container instance. Any update will result in deletion and recreation of existing containers.
type: bool type: bool
default: False default: 'no'
extends_documentation_fragment: extends_documentation_fragment:
- azure - azure
@ -145,6 +145,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 azure.mgmt.containerinstance import ContainerInstanceManagementClient from azure.mgmt.containerinstance import ContainerInstanceManagementClient
except ImportError: except ImportError:
# This is handled in azure_rm_common # This is handled in azure_rm_common
@ -383,6 +384,9 @@ class AzureRMContainerInstance(AzureRMModuleBase):
container_group_name=self.name, container_group_name=self.name,
container_group=parameters) container_group=parameters)
if isinstance(response, AzureOperationPoller):
response = self.get_poller_result(response)
return response.as_dict() return response.as_dict()
def delete_containerinstance(self): def delete_containerinstance(self):

@ -88,9 +88,9 @@ import time
from ansible.module_utils.azure_rm_common import AzureRMModuleBase from ansible.module_utils.azure_rm_common import AzureRMModuleBase
try: try:
from msrestazure.azure_exceptions import CloudError
from msrestazure.azure_operation import AzureOperationPoller
from azure.mgmt.rdbms.mysql import MySQLManagementClient from azure.mgmt.rdbms.mysql import MySQLManagementClient
from msrestazure.azure_exceptions import CloudError
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
@ -240,7 +240,7 @@ class AzureRMDatabases(AzureRMModuleBase):
server_name=self.server_name, server_name=self.server_name,
database_name=self.name, database_name=self.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:

@ -124,9 +124,9 @@ import time
from ansible.module_utils.azure_rm_common import AzureRMModuleBase from ansible.module_utils.azure_rm_common import AzureRMModuleBase
try: try:
from msrestazure.azure_exceptions import CloudError
from msrestazure.azure_operation import AzureOperationPoller
from azure.mgmt.rdbms.mysql import MySQLManagementClient from azure.mgmt.rdbms.mysql import MySQLManagementClient
from msrestazure.azure_exceptions import CloudError
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
@ -303,10 +303,15 @@ class AzureRMServers(AzureRMModuleBase):
self.log("Creating / Updating the MySQL Server instance {0}".format(self.name)) self.log("Creating / Updating the MySQL Server instance {0}".format(self.name))
try: try:
response = self.mgmt_client.servers.create_or_update(resource_group_name=self.resource_group, if (self.to_do == Actions.Create):
server_name=self.name, response = self.mgmt_client.servers.create(resource_group_name=self.resource_group,
parameters=self.parameters) server_name=self.name,
if isinstance(response, AzureOperationPoller): parameters=self.parameters)
else:
response = self.mgmt_client.servers.update(resource_group_name=self.resource_group,
server_name=self.name,
parameters=self.parameters)
if isinstance(response, LROPoller):
response = self.get_poller_result(response) response = self.get_poller_result(response)
except CloudError as exc: except CloudError as exc:

@ -88,9 +88,9 @@ import time
from ansible.module_utils.azure_rm_common import AzureRMModuleBase from ansible.module_utils.azure_rm_common import AzureRMModuleBase
try: try:
from msrestazure.azure_exceptions import CloudError
from msrestazure.azure_operation import AzureOperationPoller
from azure.mgmt.rdbms.postgresql import PostgreSQLManagementClient from azure.mgmt.rdbms.postgresql import PostgreSQLManagementClient
from msrestazure.azure_exceptions import CloudError
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
@ -240,7 +240,7 @@ class AzureRMDatabases(AzureRMModuleBase):
server_name=self.server_name, server_name=self.server_name,
database_name=self.name, database_name=self.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:

@ -124,9 +124,9 @@ import time
from ansible.module_utils.azure_rm_common import AzureRMModuleBase from ansible.module_utils.azure_rm_common import AzureRMModuleBase
try: try:
from msrestazure.azure_exceptions import CloudError
from msrestazure.azure_operation import AzureOperationPoller
from azure.mgmt.rdbms.postgresql import PostgreSQLManagementClient from azure.mgmt.rdbms.postgresql import PostgreSQLManagementClient
from msrestazure.azure_exceptions import CloudError
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
@ -311,7 +311,7 @@ class AzureRMServers(AzureRMModuleBase):
response = self.mgmt_client.servers.update(resource_group_name=self.resource_group, response = self.mgmt_client.servers.update(resource_group_name=self.resource_group,
server_name=self.name, server_name=self.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:

@ -6,8 +6,8 @@ azure-mgmt-storage>=1.5.0,<2
azure-mgmt-resource>=1.1.0,<2 azure-mgmt-resource>=1.1.0,<2
azure-storage>=0.35.1,<0.36 azure-storage>=0.35.1,<0.36
azure-cli-core>=2.0.12,<3 azure-cli-core>=2.0.12,<3
msrest!=0.4.15 msrest==0.4.29
msrestazure>=0.4.11,<0.5 msrestazure==0.4.31
azure-mgmt-dns>=1.0.1,<2 azure-mgmt-dns>=1.0.1,<2
azure-mgmt-keyvault>=0.40.0,<0.41 azure-mgmt-keyvault>=0.40.0,<0.41
azure-mgmt-batch>=4.1.0,<5 azure-mgmt-batch>=4.1.0,<5
@ -15,5 +15,5 @@ azure-mgmt-sql>=0.7.1,<0.8
azure-mgmt-web>=0.32.0,<0.33 azure-mgmt-web>=0.32.0,<0.33
azure-mgmt-containerservice>=2.0.0,<3.0.0 azure-mgmt-containerservice>=2.0.0,<3.0.0
azure-mgmt-containerregistry>=1.0.1 azure-mgmt-containerregistry>=1.0.1
azure-mgmt-rdbms>=0.2.0rc1,<0.3.0 azure-mgmt-rdbms==1.2.0
azure-mgmt-containerinstance>=0.3.1 azure-mgmt-containerinstance==0.4.0

@ -14,18 +14,18 @@
ports: ports:
- 80 - 80
- 81 - 81
- name: mycontainer2
image: httpd
memory: 1.5
register: output register: output
- debug:
var: output
- name: Assert the container instance is well created - name: Assert the container instance is well created
assert: assert:
that: that:
- output.changed - output.changed
- output.provisioning_state == 'Creating' - output.provisioning_state == 'Succeeded'
- name: Create sample container instance - name: Create sample container instance -- same parameters
azure_rm_containerinstance: azure_rm_containerinstance:
resource_group: "{{ resource_group }}" resource_group: "{{ resource_group }}"
name: "aci{{ resource_group | hash('md5') | truncate(7, True, '') }}" name: "aci{{ resource_group | hash('md5') | truncate(7, True, '') }}"
@ -41,9 +41,6 @@
ports: ports:
- 80 - 80
- 81 - 81
- name: mycontainer2
image: httpd
memory: 1.5
register: output register: output
- name: Assert the container instance is well created - name: Assert the container instance is well created
@ -51,7 +48,7 @@
that: that:
- output.changed == False - output.changed == False
- name: Create sample container instance - name: Create sample container instance -- force update
azure_rm_containerinstance: azure_rm_containerinstance:
resource_group: "{{ resource_group }}" resource_group: "{{ resource_group }}"
name: "aci{{ resource_group | hash('md5') | truncate(7, True, '') }}" name: "aci{{ resource_group | hash('md5') | truncate(7, True, '') }}"
@ -74,7 +71,7 @@
assert: assert:
that: that:
- output.changed - output.changed
- output.provisioning_state == 'Creating' - output.provisioning_state == 'Succeeded'
- name: Remove container instance - name: Remove container instance
azure_rm_containerinstance: azure_rm_containerinstance:

@ -8,8 +8,8 @@
resource_group: "{{ resource_group }}" resource_group: "{{ resource_group }}"
name: mysqlsrv{{ rpfx }} name: mysqlsrv{{ rpfx }}
sku: sku:
name: MYSQLB50 name: GP_Gen4_2
tier: basic tier: GeneralPurpose
location: westus location: westus
storage_mb: 51200 storage_mb: 51200
version: 5.6 version: 5.6

@ -8,8 +8,8 @@
resource_group: "{{ resource_group }}" resource_group: "{{ resource_group }}"
name: mysqlsrv{{ rpfx }} name: mysqlsrv{{ rpfx }}
sku: sku:
name: MYSQLB50 name: GP_Gen4_2
tier: basic tier: GeneralPurpose
location: westus location: westus
storage_mb: 51200 storage_mb: 51200
version: 5.6 version: 5.6
@ -28,8 +28,8 @@
resource_group: "{{ resource_group }}" resource_group: "{{ resource_group }}"
name: mysqlsrv{{ rpfx }} name: mysqlsrv{{ rpfx }}
sku: sku:
name: MYSQLB50 name: GP_Gen4_2
tier: basic tier: GeneralPurpose
location: westus location: westus
storage_mb: 51200 storage_mb: 51200
version: 5.6 version: 5.6
@ -48,8 +48,8 @@
resource_group: "{{ resource_group }}" resource_group: "{{ resource_group }}"
name: mysqlsrv{{ rpfx }} name: mysqlsrv{{ rpfx }}
sku: sku:
name: MYSQLB50 name: GP_Gen4_2
tier: basic tier: GeneralPurpose
location: westus location: westus
storage_mb: 51200 storage_mb: 51200
version: 5.6 version: 5.6

@ -8,8 +8,8 @@
resource_group: "{{ resource_group }}" resource_group: "{{ resource_group }}"
name: postgresqlsrv{{ rpfx }} name: postgresqlsrv{{ rpfx }}
sku: sku:
name: PGSQLS100 name: GP_Gen4_2
tier: basic tier: GeneralPurpose
location: westus location: westus
storage_mb: 51200 storage_mb: 51200
enforce_ssl: True enforce_ssl: True

@ -8,8 +8,8 @@
resource_group: "{{ resource_group }}" resource_group: "{{ resource_group }}"
name: postgresqlsrv{{ rpfx }} name: postgresqlsrv{{ rpfx }}
sku: sku:
name: PGSQLS100 name: GP_Gen4_2
tier: basic tier: GeneralPurpose
location: westus location: westus
storage_mb: 51200 storage_mb: 51200
enforce_ssl: True enforce_ssl: True
@ -27,8 +27,8 @@
resource_group: "{{ resource_group }}" resource_group: "{{ resource_group }}"
name: postgresqlsrv{{ rpfx }} name: postgresqlsrv{{ rpfx }}
sku: sku:
name: PGSQLS100 name: GP_Gen4_2
tier: basic tier: GeneralPurpose
location: westus location: westus
storage_mb: 51200 storage_mb: 51200
enforce_ssl: True enforce_ssl: True
@ -46,8 +46,8 @@
resource_group: "{{ resource_group }}" resource_group: "{{ resource_group }}"
name: postgresqlsrv{{ rpfx }} name: postgresqlsrv{{ rpfx }}
sku: sku:
name: PGSQLS100 name: GP_Gen4_2
tier: basic tier: GeneralPurpose
location: westus location: westus
storage_mb: 51200 storage_mb: 51200
enforce_ssl: True enforce_ssl: True

@ -6,8 +6,8 @@ azure-mgmt-storage>=1.5.0,<2
azure-mgmt-resource>=1.1.0,<2 azure-mgmt-resource>=1.1.0,<2
azure-storage>=0.35.1,<0.36 azure-storage>=0.35.1,<0.36
azure-cli-core>=2.0.12,<3 azure-cli-core>=2.0.12,<3
msrest!=0.4.15 msrest==0.4.29
msrestazure>=0.4.11,<0.5 msrestazure==0.4.31
azure-mgmt-dns>=1.0.1,<2 azure-mgmt-dns>=1.0.1,<2
azure-mgmt-keyvault>=0.40.0,<0.41 azure-mgmt-keyvault>=0.40.0,<0.41
azure-mgmt-batch>=4.1.0,<5 azure-mgmt-batch>=4.1.0,<5
@ -15,5 +15,5 @@ azure-mgmt-sql>=0.7.1,<0.8
azure-mgmt-web>=0.32.0,<0.33 azure-mgmt-web>=0.32.0,<0.33
azure-mgmt-containerservice>=2.0.0,<3.0.0 azure-mgmt-containerservice>=2.0.0,<3.0.0
azure-mgmt-containerregistry>=1.0.1 azure-mgmt-containerregistry>=1.0.1
azure-mgmt-rdbms>=0.2.0rc1,<0.3.0 azure-mgmt-rdbms==1.2.0
azure-mgmt-containerinstance>=0.3.1 azure-mgmt-containerinstance==0.4.0

Loading…
Cancel
Save