提交 7df278b5 编写于 作者: L Lucas Meneghel Rodrigues 提交者: Lucas Meneghel Rodrigues

Merge pull request #92 from ruda/has_virt_support

avocado.utils.virt: Be quiet if libvirt is not present
......@@ -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.
先完成此消息的编辑!
想要评论请 注册