@ -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 ) :
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 ,
server_name = self . name ,
parameters = self . parameters )
parameters = self . parameters )
if isinstance ( response , AzureOperationPoller ) :
if isinstance ( response , LRO Poller) :
response = self . get_poller_result ( response )
response = self . get_poller_result ( response )
except CloudError as exc :
except CloudError as exc :