提交 fce50f4e 编写于 作者: R Rudá Moura 提交者: Ruda Moura

avocado.utils.virt: Be quiet if libvirt is not present

Avoid to print message that libvirt is not installed,
just disable "run_vm plugin" and stop polluting the output.
Signed-off-by: NRuda Moura <rmoura@redhat.com>
上级 fa6e1a21
......@@ -250,6 +250,9 @@ class RunVM(plugin.Plugin):
enabled = True
def configure(self, app_parser, cmd_parser):
if virt.virt_capable is False:
self.enabled = False
return
username = getpass.getuser()
self.parser = app_parser
app_parser.add_argument('--vm', action='store_true', default=False,
......
......@@ -16,7 +16,12 @@
Module to provide classes for Virtual Machines.
"""
import libvirt
try:
import libvirt
except ImportError:
virt_capable = False
else:
virt_capable = True
from xml.dom import minidom
from avocado.utils import remote
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册