Catch error in azure related to a failed deployment when creating a vm
This commit is contained in:
parent
09b16c987d
commit
de94863eb1
1 changed files with 6 additions and 3 deletions
|
@ -301,8 +301,11 @@ def create_virtual_machine(module, azure):
|
|||
module.fail_json(msg="failed to create the new virtual machine, error was: %s" % str(e))
|
||||
|
||||
|
||||
try:
|
||||
deployment = azure.get_deployment_by_name(service_name=name, deployment_name=name)
|
||||
return (changed, urlparse(deployment.url).hostname, deployment)
|
||||
except WindowsAzureError as e:
|
||||
module.fail_json(msg="failed to lookup the deployment information for %s, error was: %s" % (name, str(e)))
|
||||
|
||||
|
||||
def terminate_virtual_machine(module, azure):
|
||||
|
|
Loading…
Reference in a new issue