reappied changes in a new pr (#41228)

This commit is contained in:
Zim Kalinowski 2018-06-13 15:42:29 +08:00 committed by Yunge Zhu
parent 063d19048d
commit 5b0bb91c72
12 changed files with 38 additions and 35 deletions

View file

@ -95,9 +95,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
@ -247,7 +247,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:

View file

@ -135,9 +135,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
@ -314,10 +314,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:

View file

@ -95,9 +95,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
@ -247,7 +247,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:

View file

@ -135,9 +135,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
@ -322,7 +322,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:

View file

@ -12,7 +12,7 @@ azure-mgmt-dns==1.2.0
azure-mgmt-keyvault==0.40.0 azure-mgmt-keyvault==0.40.0
azure-mgmt-network==1.7.1 azure-mgmt-network==1.7.1
azure-mgmt-nspkg==2.0.0 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-resource==1.2.2
azure-mgmt-sql==0.7.1 azure-mgmt-sql==0.7.1
azure-mgmt-storage==1.5.0 azure-mgmt-storage==1.5.0

View file

@ -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

View file

@ -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

View file

@ -1,4 +1,3 @@
cloud/azure cloud/azure
destructive destructive
posix/ci/cloud/group2/azure posix/ci/cloud/group2/azure
unstable

View file

@ -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

View file

@ -1,4 +1,3 @@
cloud/azure cloud/azure
destructive destructive
posix/ci/cloud/group2/azure posix/ci/cloud/group2/azure
unstable

View file

@ -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

View file

@ -12,7 +12,7 @@ azure-mgmt-dns==1.2.0
azure-mgmt-keyvault==0.40.0 azure-mgmt-keyvault==0.40.0
azure-mgmt-network==1.7.1 azure-mgmt-network==1.7.1
azure-mgmt-nspkg==2.0.0 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-resource==1.2.2
azure-mgmt-sql==0.7.1 azure-mgmt-sql==0.7.1
azure-mgmt-storage==1.5.0 azure-mgmt-storage==1.5.0