From: Ondrej Lichtner <olichtne(a)redhat.com>
The HostAPI class should ignore unused interfaces (specified in slave
config but not matched to the current recipe run), unfortunatelly the
code assumed that these have a None id. This is incorrect as they get a
generated id in the form of "gen_%s_%d".
To fix this we should ignore interface objects that are instances of the
UnusedInterface class.
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
---
lnst/Controller/Task.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lnst/Controller/Task.py b/lnst/Controller/Task.py
index e91409e..8121746 100644
--- a/lnst/Controller/Task.py
+++ b/lnst/Controller/Task.py
@@ -19,6 +19,7 @@ from lnst.Controller.XmlTemplates import XmlTemplateError
from lnst.Common.Path import Path
from lnst.Controller.PerfRepoMapping import PerfRepoMapping
from lnst.Common.Utils import Noop
+from lnst.Controller.Machine import UnusedInterface
try:
from perfrepo import PerfRepoRESTAPI
@@ -192,7 +193,7 @@ class HostAPI(object):
self._ifaces = {}
for interface in self._m.get_interfaces():
- if interface.get_id() is None:
+ if not isinstance(interface, UnusedInterface):
continue
self._ifaces[interface.get_id()] = InterfaceAPI(interface, self)
--
2.11.0
Show replies by thread