From a56171027c09f98a448dffdc9b19d853d82be50f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rud=C3=A1=20Moura?= Date: Wed, 11 Jun 2014 10:37:39 -0300 Subject: [PATCH] avocado.utils.remote: Log when module is disabled. Log message if remote or virt module is off. Signed-off-by: Ruda Moura --- avocado/utils/remote.py | 4 ++++ avocado/utils/virt.py | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/avocado/utils/remote.py b/avocado/utils/remote.py index b5787bb6..7e3cd8b4 100644 --- a/avocado/utils/remote.py +++ b/avocado/utils/remote.py @@ -17,12 +17,16 @@ Module to provide remote operations. """ import getpass +import logging + +log = logging.getLogger('avocado.test') try: import fabric.api import fabric.operations except ImportError: remote_capable = False + log.info('Remote module is disabled: could not import fabric') else: remote_capable = True diff --git a/avocado/utils/virt.py b/avocado/utils/virt.py index 70002140..02b79136 100644 --- a/avocado/utils/virt.py +++ b/avocado/utils/virt.py @@ -16,10 +16,15 @@ Module to provide classes for Virtual Machines. """ +import logging + +log = logging.getLogger('avocado.test') + try: import libvirt except ImportError: virt_capable = False + log.info('Virt module is disabled: could not import libvirt') else: virt_capable = True @@ -28,6 +33,7 @@ from avocado.utils import remote if remote.remote_capable is False: virt_capable = False + log.info('Virt module is disabled: remote module is disabled') class Hypervisor(object): -- GitLab