diff options
author | Radostin Stoyanov <rstoyanov1@gmail.com> | 2017-11-01 00:19:46 +0000 |
---|---|---|
committer | Radostin Stoyanov <rstoyanov1@gmail.com> | 2017-11-21 11:32:39 +0000 |
commit | 39f655e7799c5c80e316c048a7b05ac2c01d2528 (patch) | |
tree | d70d8b7393748a8ae0e42b99cea55166f6038e96 | |
parent | 4f0ea4dc53ce9097b673ef8541e9affd7fed4680 (diff) | |
download | virt-bootstrap.git-39f655e7799c5c80e316c048a7b05ac2c01d2528.tar.gz virt-bootstrap.git-39f655e7799c5c80e316c048a7b05ac2c01d2528.tar.xz virt-bootstrap.git-39f655e7799c5c80e316c048a7b05ac2c01d2528.zip |
Show error when guestfs-python is not installed
Show appropriate error message when the python bindings for
libguestfs are not installed.
-rw-r--r-- | src/virtBootstrap/utils.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/virtBootstrap/utils.py b/src/virtBootstrap/utils.py index ea84ed3..20a59d2 100644 --- a/src/virtBootstrap/utils.py +++ b/src/virtBootstrap/utils.py @@ -33,9 +33,14 @@ import sys import tempfile import logging -import guestfs import passlib.hosts +try: + import guestfs +except ImportError: + raise RuntimeError('Python bindings for libguestfs are not installed') + + # pylint: disable=invalid-name # Create logger logger = logging.getLogger(__name__) |