From 6443d90808a91c3801241b32c5b8069c3c31d1ac Mon Sep 17 00:00:00 2001 From: Matt Martz Date: Fri, 13 Dec 2013 19:34:33 -0600 Subject: [PATCH] Don't import novaclient, exceptions are available via cs.exceptions --- cloud/rax_keypair | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/cloud/rax_keypair b/cloud/rax_keypair index 4a09f64b6a1..0df4ceb73a4 100644 --- a/cloud/rax_keypair +++ b/cloud/rax_keypair @@ -98,8 +98,6 @@ except ImportError: print("failed=True msg='pyrax required for this module'") sys.exit(1) -from novaclient.exceptions import NotFound - NON_CALLABLES = (basestring, bool, dict, int, list, NoneType) @@ -121,7 +119,7 @@ def rax_keypair(module, name, public_key, state): if state == 'present': try: keypair = cs.keypairs.find(name=name) - except NotFound: + except cs.exceptions.NotFound: try: keypair = cs.keypairs.create(name, public_key) changed = True