This is a fix for corner case bug introduced by recent commit
92b8ae0dc8ac25a10835d9898172980b3af89ec1.
The problem is that if the match results with at least one
UnusedInterface we end up iterating over such interface that
unfortunately does not have self._id set since it defaults to
None.
The solution is to query driver information for StaticInterface
interface classes only.
Fixes #131
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
---
lnst/Controller/NetTestController.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/lnst/Controller/NetTestController.py b/lnst/Controller/NetTestController.py
index e12d349..ec0db54 100644
--- a/lnst/Controller/NetTestController.py
+++ b/lnst/Controller/NetTestController.py
@@ -27,6 +27,7 @@ from lnst.Common.NetTestCommand import str_command, CommandException
from lnst.Controller.RecipeParser import RecipeParser, RecipeError
from lnst.Controller.SlavePool import SlavePool
from lnst.Controller.Machine import MachineError, VirtualInterface
+from lnst.Controller.Machine import StaticInterface
from lnst.Common.ConnectionHandler import send_data, recv_data
from lnst.Common.ConnectionHandler import ConnectionHandler
from lnst.Common.Config import lnst_config
@@ -201,7 +202,8 @@ class NetTestController:
for iface in ifaces:
iface.configure()
- if m._libvirt_domain is None:
+ if (m._libvirt_domain is None and
+ isinstance(iface, StaticInterface)):
driver = iface._driver
if_id = iface._id
mapped_machine = self._slave_pool._map['machines'][m_id]
--
1.9.3