diff options
author | Evgenii Terechkov <evg@altlinux.org> | 2013-12-03 20:21:16 +0800 |
---|---|---|
committer | Evgenii Terechkov <evg@altlinux.org> | 2013-12-03 20:21:16 +0800 |
commit | dc17b0751d6b812a5ff6d03f488ab1552a44360e (patch) | |
tree | 9fde64985958ebf5c1b21fbf11b6e80bc53d44c8 /cloud/ovirt | |
parent | 21144a30147e91b54a9f945f03b488674296eb5d (diff) | |
download | ansible-modules-extras-dc17b0751d6b812a5ff6d03f488ab1552a44360e.tar.gz |
Use ovirtsdk if it installed, but fall out gracefully if it is not
Diffstat (limited to 'cloud/ovirt')
-rwxr-xr-x[-rw-r--r--] | cloud/ovirt | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/cloud/ovirt b/cloud/ovirt index b71d3303..fb84e918 100644..100755 --- a/cloud/ovirt +++ b/cloud/ovirt @@ -205,8 +205,12 @@ action: ovirt > ''' -from ovirtsdk.api import API -from ovirtsdk.xml import params +try: + from ovirtsdk.api import API + from ovirtsdk.xml import params +except ImportError: + print "failed=True msg='ovirtsdk required for this module'" + sys.exit(1) # ------------------------------------------------------------------- # # create connection with API |