Tue, Feb 18, 2014 at 05:23:40PM CET, jtluka(a)redhat.com wrote:
Tue, Feb 18, 2014 at 04:24:52PM CET, jtluka(a)redhat.com wrote:
>Hi, I've hit following traceback:
>
>Traceback (most recent call last):
> File "/usr/bin/lnst-ctl", line 24, in <module>
> from lnst.Controller.NetTestController import NetTestController, NetTestError
> File
"/usr/lib/python2.7/site-packages/lnst/Controller/NetTestController.py", line
24, in <module>
> from lnst.Common.VirtUtils import VirtNetCtl, VirtDomainCtl
> File "/usr/lib/python2.7/site-packages/lnst/Common/VirtUtils.py", line 23,
in <module>
> _libvirt_conn = libvirt.open(None)
> File "/usr/lib64/python2.7/site-packages/libvirt.py", line 236, in open
> if ret is None:raise libvirtError('virConnectOpen() failed')
>libvirt.libvirtError: Failed to connect socket to
>'/var/run/libvirt/libvirt-sock': No such file or directory
>
>This leads me to the question whether we should implement this
>differently in on-demand way, e.g. set _libvirt_conn to None and have a
>function that initiates this connection once we know that the guests
>will be used. Currently we're relying on virtualization software
>installed. In case the pool consists only from bare metal machines this
>is not guaranteed.
>
>Any opinion on this?
>
>-Jan
Seems that this can be done a lot more easier by moving the import to the
parts of the code where we actually need it. Not 100% sure this will work.
Yep, This should be done only in case it is needed. Shat should resolve
the problem. Also, I think it would be nicer to catch the exception and
print some nice error message instead of the trace.
jiri
_______________________________________________
LNST-developers mailing list
LNST-developers(a)lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/lnst-developers