From f7c4668a4d95204540f642140cb90167308f7e45 Mon Sep 17 00:00:00 2001 From: Michael Scherer Date: Tue, 4 Mar 2014 17:30:15 +0100 Subject: [PATCH] Fix wrong module name for exception in nova compute failed: [127.0.0.1] => {"failed": true, "parsed": false} invalid output was: Traceback (most recent call last): File "/tmp/ansible-tmp-1393950384.39-102240090845592/nova_compute", line 1328, in main() File "/tmp/ansible-tmp-1393950384.39-102240090845592/nova_compute", line 241, in main except exc.Unauthorized, e: NameError: global name 'exc' is not defined --- library/cloud/nova_compute | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/cloud/nova_compute b/library/cloud/nova_compute index af693229333..d0bc79b1a2a 100644 --- a/library/cloud/nova_compute +++ b/library/cloud/nova_compute @@ -238,9 +238,9 @@ def main(): service_type='compute') try: nova.authenticate() - except exc.Unauthorized, e: + except exceptions.Unauthorized, e: module.fail_json(msg = "Invalid OpenStack Nova credentials.: %s" % e.message) - except exc.AuthorizationFailure, e: + except exceptions.AuthorizationFailure, e: module.fail_json(msg = "Unable to authorize user: %s" % e.message) if module.params['state'] == 'present':