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 <module>
      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
release1.5.1
Michael Scherer 11 years ago committed by James Cammarata
parent dd3fa2aebe
commit f7c4668a4d

@ -238,9 +238,9 @@ def main():
service_type='compute') service_type='compute')
try: try:
nova.authenticate() nova.authenticate()
except exc.Unauthorized, e: except exceptions.Unauthorized, e:
module.fail_json(msg = "Invalid OpenStack Nova credentials.: %s" % e.message) 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) module.fail_json(msg = "Unable to authorize user: %s" % e.message)
if module.params['state'] == 'present': if module.params['state'] == 'present':

Loading…
Cancel
Save