Fix broken Azure dependencies in 2.6 (#41946)

* fixed requirements
* module fix
* updated test accordingly
* mysql & postgresl fixes
* upgraded databases
* removed test from ignore.txt
* updated mysql & postgresql tests
pull/41932/merge
Zim Kalinowski 7 years ago committed by Matt Clay
parent 0f477d1318
commit 701d61531c

@ -50,6 +50,7 @@ options:
choices:
- public
- none
default: 'none'
ports:
description:
- List of ports exposed within the container group.
@ -144,6 +145,7 @@ from ansible.module_utils.azure_rm_common import AzureRMModuleBase
try:
from msrestazure.azure_exceptions import CloudError
from msrestazure.azure_operation import AzureOperationPoller
from azure.mgmt.containerinstance import ContainerInstanceManagementClient
except ImportError:
# This is handled in azure_rm_common
@ -382,6 +384,9 @@ class AzureRMContainerInstance(AzureRMModuleBase):
container_group_name=self.name,
container_group=parameters)
if isinstance(response, AzureOperationPoller):
response = self.get_poller_result(response)
return response.as_dict()
def delete_containerinstance(self):

@ -96,9 +96,9 @@ import time
from ansible.module_utils.azure_rm_common import AzureRMModuleBase
try:
from msrestazure.azure_exceptions import CloudError
from msrestazure.azure_operation import AzureOperationPoller
from azure.mgmt.rdbms.mysql import MySQLManagementClient
from msrestazure.azure_exceptions import CloudError
from msrest.polling import LROPoller
from msrest.serialization import Model
except ImportError:
# This is handled in azure_rm_common
@ -248,7 +248,7 @@ class AzureRMDatabases(AzureRMModuleBase):
server_name=self.server_name,
database_name=self.name,
parameters=self.parameters)
if isinstance(response, AzureOperationPoller):
if isinstance(response, LROPoller):
response = self.get_poller_result(response)
except CloudError as exc:

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

@ -96,9 +96,9 @@ import time
from ansible.module_utils.azure_rm_common import AzureRMModuleBase
try:
from msrestazure.azure_exceptions import CloudError
from msrestazure.azure_operation import AzureOperationPoller
from azure.mgmt.rdbms.postgresql import PostgreSQLManagementClient
from msrestazure.azure_exceptions import CloudError
from msrest.polling import LROPoller
from msrest.serialization import Model
except ImportError:
# This is handled in azure_rm_common
@ -248,7 +248,7 @@ class AzureRMDatabases(AzureRMModuleBase):
server_name=self.server_name,
database_name=self.name,
parameters=self.parameters)
if isinstance(response, AzureOperationPoller):
if isinstance(response, LROPoller):
response = self.get_poller_result(response)
except CloudError as exc:

@ -137,9 +137,9 @@ import time
from ansible.module_utils.azure_rm_common import AzureRMModuleBase
try:
from msrestazure.azure_exceptions import CloudError
from msrestazure.azure_operation import AzureOperationPoller
from azure.mgmt.rdbms.postgresql import PostgreSQLManagementClient
from msrestazure.azure_exceptions import CloudError
from msrest.polling import LROPoller
from msrest.serialization import Model
except ImportError:
# This is handled in azure_rm_common
@ -324,7 +324,7 @@ class AzureRMServers(AzureRMModuleBase):
response = self.mgmt_client.servers.update(resource_group_name=self.resource_group,
server_name=self.name,
parameters=self.parameters)
if isinstance(response, AzureOperationPoller):
if isinstance(response, LROPoller):
response = self.get_poller_result(response)
except CloudError as exc:

@ -5,14 +5,14 @@ azure-cli-nspkg==3.0.2
azure-common==1.1.11
azure-mgmt-batch==4.1.0
azure-mgmt-compute==2.1.0
azure-mgmt-containerinstance==0.3.1
azure-mgmt-containerinstance==0.4.0
azure-mgmt-containerregistry==2.0.0
azure-mgmt-containerservice==3.0.1
azure-mgmt-dns==1.2.0
azure-mgmt-keyvault==0.40.0
azure-mgmt-network==1.7.1
azure-mgmt-nspkg==2.0.0
azure-mgmt-rdbms==0.2.0rc1
azure-mgmt-rdbms==1.2.0
azure-mgmt-resource==1.2.2
azure-mgmt-sql==0.7.1
azure-mgmt-storage==1.5.0

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

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

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

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

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

@ -5,14 +5,14 @@ azure-cli-nspkg==3.0.2
azure-common==1.1.11
azure-mgmt-batch==4.1.0
azure-mgmt-compute==2.1.0
azure-mgmt-containerinstance==0.3.1
azure-mgmt-containerinstance==0.4.0
azure-mgmt-containerregistry==2.0.0
azure-mgmt-containerservice==3.0.1
azure-mgmt-dns==1.2.0
azure-mgmt-keyvault==0.40.0
azure-mgmt-network==1.7.1
azure-mgmt-nspkg==2.0.0
azure-mgmt-rdbms==0.2.0rc1
azure-mgmt-rdbms==1.2.0
azure-mgmt-resource==1.2.2
azure-mgmt-sql==0.7.1
azure-mgmt-storage==1.5.0

@ -145,7 +145,6 @@ lib/ansible/modules/cloud/atomic/atomic_container.py E317
lib/ansible/modules/cloud/atomic/atomic_container.py E326
lib/ansible/modules/cloud/azure/_azure.py E324
lib/ansible/modules/cloud/azure/_azure.py E326
lib/ansible/modules/cloud/azure/azure_rm_containerinstance.py E324
lib/ansible/modules/cloud/centurylink/clc_alert_policy.py E317
lib/ansible/modules/cloud/centurylink/clc_firewall_policy.py E317
lib/ansible/modules/cloud/centurylink/clc_firewall_policy.py E324

Loading…
Cancel
Save