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