diff options
author | Toshio Kuratomi <a.badger@gmail.com> | 2017-09-09 16:20:53 -0700 |
---|---|---|
committer | Toshio Kuratomi <a.badger@gmail.com> | 2017-09-09 16:21:20 -0700 |
commit | 4e5051fe00ee35a9aa8fb4581569ded1aa58fed8 (patch) | |
tree | 2687cf88b002c538962d550e7f4a8b28dcc6a6a9 | |
parent | 1478d0fcf302a3df2bd2894d1045c05fbf575376 (diff) | |
download | ansible-4e5051fe00ee35a9aa8fb4581569ded1aa58fed8.tar.gz |
Romain dartigues fixes (#29169)
* cloud: azure: fix typo introduced in commit 16d23e9
The commit "Add reference to VNET resource group (#26052)"
removed an used variable.
* network: aos: error hint never shown
(cherry picked from commit 67972211078bc413fe0c589718dd0af795c3097e)
-rw-r--r-- | lib/ansible/modules/cloud/azure/azure_rm_virtualmachine.py | 2 | ||||
-rw-r--r-- | lib/ansible/modules/network/aos/aos_blueprint.py | 7 |
2 files changed, 4 insertions, 5 deletions
diff --git a/lib/ansible/modules/cloud/azure/azure_rm_virtualmachine.py b/lib/ansible/modules/cloud/azure/azure_rm_virtualmachine.py index d9fd315bf6..50f2b0cb8c 100644 --- a/lib/ansible/modules/cloud/azure/azure_rm_virtualmachine.py +++ b/lib/ansible/modules/cloud/azure/azure_rm_virtualmachine.py @@ -1431,7 +1431,7 @@ class AzureRMVirtualMachine(AzureRMModuleBase): try: self.network_client.virtual_networks.list(virtual_network_resource_group, self.virtual_network_name) virtual_network_name = self.virtual_network_name - except CloudError: + except CloudError as exc: self.fail("Error: fetching virtual network {0} - {1}".format(self.virtual_network_name, str(exc))) else: diff --git a/lib/ansible/modules/network/aos/aos_blueprint.py b/lib/ansible/modules/network/aos/aos_blueprint.py index b7df88e8be..1d3e550fdc 100644 --- a/lib/ansible/modules/network/aos/aos_blueprint.py +++ b/lib/ansible/modules/network/aos/aos_blueprint.py @@ -150,12 +150,11 @@ def create_blueprint(module, aos, name): except: exc = get_exception() + msg = "Unable to create blueprint: %s" % exc.message if 'UNPROCESSABLE ENTITY' in exc.message: - msg = 'likely missing dependencies' - else: - msg = exc.message + msg+= ' (likely missing dependencies)' - module.fail_json(msg="Unable to create blueprint: %s" % exc.message) + module.fail_json(msg=msg) return blueprint |