From b5d8aa9ff1f9928cfd903f053cc9d6b1e02a0838 Mon Sep 17 00:00:00 2001 From: Evgenii Terechkov Date: Tue, 3 Dec 2013 20:21:16 +0800 Subject: [PATCH] Use ovirtsdk if it installed, but fall out gracefully if it is not --- library/cloud/ovirt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) mode change 100644 => 100755 library/cloud/ovirt diff --git a/library/cloud/ovirt b/library/cloud/ovirt old mode 100644 new mode 100755 index b71d330375..fb84e91800 --- a/library/cloud/ovirt +++ b/library/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