Use ovirtsdk if it installed, but fall out gracefully if it is not
This commit is contained in:
parent
21144a3014
commit
dc17b0751d
1 changed files with 6 additions and 2 deletions
8
cloud/ovirt
Normal file → Executable file
8
cloud/ovirt
Normal file → Executable file
|
@ -205,8 +205,12 @@ action: ovirt >
|
||||||
|
|
||||||
|
|
||||||
'''
|
'''
|
||||||
from ovirtsdk.api import API
|
try:
|
||||||
from ovirtsdk.xml import params
|
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
|
# create connection with API
|
||||||
|
|
Loading…
Reference in a new issue