Commit 925eb1dc by Matt Martz

Don't import novaclient, exceptions are available via cs.exceptions

parent b3744800
...@@ -98,8 +98,6 @@ except ImportError: ...@@ -98,8 +98,6 @@ except ImportError:
print("failed=True msg='pyrax required for this module'") print("failed=True msg='pyrax required for this module'")
sys.exit(1) sys.exit(1)
from novaclient.exceptions import NotFound
NON_CALLABLES = (basestring, bool, dict, int, list, NoneType) NON_CALLABLES = (basestring, bool, dict, int, list, NoneType)
...@@ -121,7 +119,7 @@ def rax_keypair(module, name, public_key, state): ...@@ -121,7 +119,7 @@ def rax_keypair(module, name, public_key, state):
if state == 'present': if state == 'present':
try: try:
keypair = cs.keypairs.find(name=name) keypair = cs.keypairs.find(name=name)
except NotFound: except cs.exceptions.NotFound:
try: try:
keypair = cs.keypairs.create(name, public_key) keypair = cs.keypairs.create(name, public_key)
changed = True changed = True
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment