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)
if 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)

@ -50,7 +50,7 @@ options:
choices:
- public
- none
default: None
default: 'none'
ports:
description:
- List of ports exposed within the container group.
@ -93,7 +93,7 @@ options:
description:
- Force update of existing container instance. Any update will result in deletion and recreation of existing containers.
type: bool
default: False
default: 'no'
extends_documentation_fragment:
- azure
@ -145,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
@ -383,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):

@ -88,9 +88,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
@ -240,7 +240,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:

@ -124,9 +124,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
@ -303,10 +303,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,
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, AzureOperationPoller):
if isinstance(response, LROPoller):
response = self.get_poller_result(response)
except CloudError as exc:

@ -88,9 +88,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
@ -240,7 +240,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:

@ -124,9 +124,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
@ -311,7 +311,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:

@ -6,8 +6,8 @@ azure-mgmt-storage>=1.5.0,<2
azure-mgmt-resource>=1.1.0,<2
azure-storage>=0.35.1,<0.36
azure-cli-core>=2.0.12,<3
msrest!=0.4.15
msrestazure>=0.4.11,<0.5
msrest==0.4.29
msrestazure==0.4.31
azure-mgmt-dns>=1.0.1,<2
azure-mgmt-keyvault>=0.40.0,<0.41
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-containerservice>=2.0.0,<3.0.0
azure-mgmt-containerregistry>=1.0.1
azure-mgmt-rdbms>=0.2.0rc1,<0.3.0
azure-mgmt-containerinstance>=0.3.1
azure-mgmt-rdbms==1.2.0
azure-mgmt-containerinstance==0.4.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

@ -6,8 +6,8 @@ azure-mgmt-storage>=1.5.0,<2
azure-mgmt-resource>=1.1.0,<2
azure-storage>=0.35.1,<0.36
azure-cli-core>=2.0.12,<3
msrest!=0.4.15
msrestazure>=0.4.11,<0.5
msrest==0.4.29
msrestazure==0.4.31
azure-mgmt-dns>=1.0.1,<2
azure-mgmt-keyvault>=0.40.0,<0.41
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-containerservice>=2.0.0,<3.0.0
azure-mgmt-containerregistry>=1.0.1
azure-mgmt-rdbms>=0.2.0rc1,<0.3.0
azure-mgmt-containerinstance>=0.3.1
azure-mgmt-rdbms==1.2.0
azure-mgmt-containerinstance==0.4.0

Loading…
Cancel
Save