For issue #111. Since RPC connection is created after mapping, we can't get interface driver info sooner without creating extra connection to the Slave. This patch stores driver info after device configuration, after method interface_update() was called, so driver info should be present in Slave.
Signed-off-by: Jiri Prochazka jprochaz@redhat.com --- lnst/Controller/NetTestController.py | 5 +++++ lnst/Controller/NetTestResultSerializer.py | 14 +++++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/lnst/Controller/NetTestController.py b/lnst/Controller/NetTestController.py index 5c2695d..0791897 100644 --- a/lnst/Controller/NetTestController.py +++ b/lnst/Controller/NetTestController.py @@ -204,6 +204,11 @@ class NetTestController:
for iface in ifaces: iface.configure() + if m._libvirt_domain is None: + driver = iface._driver + if_id = iface._id + mapped_machine = self._slave_pool._map['machines'][m_id] + mapped_machine['interfaces'][if_id]['driver'] = driver for iface in ifaces: iface.up()
diff --git a/lnst/Controller/NetTestResultSerializer.py b/lnst/Controller/NetTestResultSerializer.py index 9f8955a..49f632c 100644 --- a/lnst/Controller/NetTestResultSerializer.py +++ b/lnst/Controller/NetTestResultSerializer.py @@ -100,9 +100,17 @@ class NetTestResultSerializer: (m_id, m["target"]), "")) for if_id, pool_if in m["interfaces"].iteritems(): pool_id = pool_if["target"] - output_pairs.append((6*" " + "interface "%s" "\ - "matched to "%s"" %\ - (if_id, pool_id), "")) + if "driver" in pool_if: + driver = pool_if["driver"] + output_pairs.append((6*" " + "interface "%s" " + "matched to "%s" " + "(driver: "%s")" % + (if_id, pool_id, + driver), "")) + else: + output_pairs.append((6*" " + "interface "%s" " + "matched to "%s" " % + (if_id, pool_id), ""))
if recipe["result"] == "FAIL" and \ "err_msg" in recipe and recipe["err_msg"] != "":
Removing all imports that Pylint has marked as unused
Signed-off-by: Jiri Prochazka jprochaz@redhat.com --- lnst/Common/Colours.py | 2 -- lnst/Common/Config.py | 3 +-- lnst/Common/LoggingHandler.py | 2 +- lnst/Common/Logs.py | 3 +-- lnst/Common/NetTestCommand.py | 3 +-- lnst/Common/PacketCapture.py | 1 - lnst/Common/ResourceCache.py | 1 - lnst/Common/TestsCommon.py | 1 - lnst/Controller/Machine.py | 10 ++-------- lnst/Controller/MessageDispatcherLite.py | 2 +- lnst/Controller/NetTestController.py | 7 ++----- lnst/Controller/NetTestResultSerializer.py | 3 +-- lnst/Controller/PerfRepo.py | 1 - lnst/Controller/RecipeParser.py | 8 -------- lnst/Controller/SlaveMachineParser.py | 4 ---- lnst/Controller/SlavePool.py | 4 ---- lnst/Controller/Task.py | 3 +-- lnst/Controller/VirtUtils.py | 2 +- lnst/Controller/XmlParser.py | 5 ++--- lnst/Controller/XmlProcessing.py | 1 - lnst/Slave/InterfaceManager.py | 1 - lnst/Slave/NetConfigDevice.py | 5 +---- lnst/Slave/NetTestSlave.py | 11 +++-------- lnst/Slave/NmConfigDevice.py | 2 -- 24 files changed, 18 insertions(+), 67 deletions(-)
diff --git a/lnst/Common/Colours.py b/lnst/Common/Colours.py index 1b72d58..e57794e 100644 --- a/lnst/Common/Colours.py +++ b/lnst/Common/Colours.py @@ -10,8 +10,6 @@ __author__ = """ rpazdera@redhat.com (Radek Pazdera) """
-import logging -import os import re from lnst.Common.Utils import bool_it
diff --git a/lnst/Common/Config.py b/lnst/Common/Config.py index e6b600b..547dd99 100644 --- a/lnst/Common/Config.py +++ b/lnst/Common/Config.py @@ -12,11 +12,10 @@ olichtne@redhat.com (Ondrej Lichtner)
import os import sys -import logging import re from ConfigParser import ConfigParser from lnst.Common.Utils import bool_it -from lnst.Common.NetUtils import verify_ip_address, verify_mac_address +from lnst.Common.NetUtils import verify_mac_address from lnst.Common.Colours import get_preset_conf
DefaultRPCPort = 9999 diff --git a/lnst/Common/LoggingHandler.py b/lnst/Common/LoggingHandler.py index 22d58f5..a236922 100644 --- a/lnst/Common/LoggingHandler.py +++ b/lnst/Common/LoggingHandler.py @@ -14,7 +14,7 @@ __autor__ = """ olichtne@redhat.com (Ondrej Lichtner) """
-import socket, struct, pickle +import pickle import logging import xmlrpclib from lnst.Common.ConnectionHandler import send_data diff --git a/lnst/Common/Logs.py b/lnst/Common/Logs.py index 233f427..23aaf05 100644 --- a/lnst/Common/Logs.py +++ b/lnst/Common/Logs.py @@ -9,11 +9,10 @@ published by the Free Software Foundation; see COPYING for details. __autor__ = """ jzupka@redhat.com (Jiri Zupka) """ -import os, sys, shutil, datetime +import os, sys, shutil from logging import Formatter import logging.handlers import traceback -from lnst.Common.LoggingHandler import LogBuffer from lnst.Common.LoggingHandler import TransmitHandler from lnst.Common.Colours import decorate_with_preset, strip_colours
diff --git a/lnst/Common/NetTestCommand.py b/lnst/Common/NetTestCommand.py index f872a12..1e404bf 100644 --- a/lnst/Common/NetTestCommand.py +++ b/lnst/Common/NetTestCommand.py @@ -15,12 +15,11 @@ import os import sys import signal import imp -import pickle, traceback import multiprocessing import re from time import time from lnst.Common.ExecCmd import exec_cmd, ExecCmdFail -from lnst.Common.ConnectionHandler import recv_data, send_data +from lnst.Common.ConnectionHandler import send_data from lnst.Common.Logs import log_exc_traceback
DEFAULT_TIMEOUT = 60 diff --git a/lnst/Common/PacketCapture.py b/lnst/Common/PacketCapture.py index 69ad5cb..f45dc99 100644 --- a/lnst/Common/PacketCapture.py +++ b/lnst/Common/PacketCapture.py @@ -10,7 +10,6 @@ __author__ = """ rpazdera@redhat.com (Radek Pazdera) """
-import logging import subprocess
class PacketCapture: diff --git a/lnst/Common/ResourceCache.py b/lnst/Common/ResourceCache.py index 8719b09..98558a2 100644 --- a/lnst/Common/ResourceCache.py +++ b/lnst/Common/ResourceCache.py @@ -14,7 +14,6 @@ import os import re import time import shutil -from lnst.Common.Utils import md5sum from lnst.Common.ExecCmd import exec_cmd
SETUP_SCRIPT_NAME = "lnst-setup.sh" diff --git a/lnst/Common/TestsCommon.py b/lnst/Common/TestsCommon.py index b471d8d..e29a609 100644 --- a/lnst/Common/TestsCommon.py +++ b/lnst/Common/TestsCommon.py @@ -12,7 +12,6 @@ jpirko@redhat.com (Jiri Pirko)
import re import logging -import sys import os import signal import time diff --git a/lnst/Controller/Machine.py b/lnst/Controller/Machine.py index a7c5ea9..a0e786c 100644 --- a/lnst/Controller/Machine.py +++ b/lnst/Controller/Machine.py @@ -14,20 +14,14 @@ rpazdera@redhat.com (Radek Pazdera) import logging import socket import os -import re -import pickle import tempfile import signal from time import sleep from xmlrpclib import Binary -from pprint import pprint, pformat from lnst.Common.Config import lnst_config -from lnst.Common.Logs import log_exc_traceback -from lnst.Common.NetUtils import MacPool, normalize_hwaddr -from lnst.Common.Utils import wait_for, md5sum, dir_md5sum, create_tar_archive +from lnst.Common.NetUtils import normalize_hwaddr +from lnst.Common.Utils import wait_for, create_tar_archive from lnst.Common.Utils import check_process_running -from lnst.Common.ConnectionHandler import send_data, recv_data -from lnst.Common.ConnectionHandler import ConnectionHandler from lnst.Common.NetTestCommand import DEFAULT_TIMEOUT
# conditional support for libvirt diff --git a/lnst/Controller/MessageDispatcherLite.py b/lnst/Controller/MessageDispatcherLite.py index e86c077..2973763 100644 --- a/lnst/Controller/MessageDispatcherLite.py +++ b/lnst/Controller/MessageDispatcherLite.py @@ -11,7 +11,7 @@ __author__ = """ jpirko@redhat.com (Jiri Pirko) """
-from lnst.Common.ConnectionHandler import send_data, recv_data +from lnst.Common.ConnectionHandler import send_data from lnst.Common.ConnectionHandler import ConnectionHandler from lnst.Controller.NetTestController import NetTestError
diff --git a/lnst/Controller/NetTestController.py b/lnst/Controller/NetTestController.py index 0791897..e12d349 100644 --- a/lnst/Controller/NetTestController.py +++ b/lnst/Controller/NetTestController.py @@ -16,20 +16,17 @@ import socket import os import re import cPickle -import tempfile import imp import copy import sys from time import sleep -from xmlrpclib import Binary from lnst.Common.NetUtils import MacPool -from lnst.Common.Utils import wait_for, md5sum, dir_md5sum, create_tar_archive +from lnst.Common.Utils import md5sum, dir_md5sum from lnst.Common.Utils import check_process_running, bool_it, get_module_tools -from lnst.Common.NetTestCommand import NetTestCommandContext, NetTestCommand 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 Machine, MachineError, VirtualInterface +from lnst.Controller.Machine import MachineError, VirtualInterface from lnst.Common.ConnectionHandler import send_data, recv_data from lnst.Common.ConnectionHandler import ConnectionHandler from lnst.Common.Config import lnst_config diff --git a/lnst/Controller/NetTestResultSerializer.py b/lnst/Controller/NetTestResultSerializer.py index 49f632c..3650981 100644 --- a/lnst/Controller/NetTestResultSerializer.py +++ b/lnst/Controller/NetTestResultSerializer.py @@ -14,8 +14,7 @@ jpirko@redhat.com (Jiri Pirko) import logging import datetime from xml.dom.minidom import getDOMImplementation -from lnst.Common.NetTestCommand import str_command -from lnst.Common.Colours import decorate_string, decorate_with_preset +from lnst.Common.Colours import decorate_with_preset from lnst.Common.Config import lnst_config from lxml import etree
diff --git a/lnst/Controller/PerfRepo.py b/lnst/Controller/PerfRepo.py index ffc29d5..4ba0147 100644 --- a/lnst/Controller/PerfRepo.py +++ b/lnst/Controller/PerfRepo.py @@ -11,7 +11,6 @@ olichtne@redhat.com (Ondrej Lichtner) """
import requests -import collections import datetime import re from types import StringType, NoneType diff --git a/lnst/Controller/RecipeParser.py b/lnst/Controller/RecipeParser.py index 73422f1..0f35581 100644 --- a/lnst/Controller/RecipeParser.py +++ b/lnst/Controller/RecipeParser.py @@ -10,19 +10,11 @@ __author__ = """ rpazdera@redhat.com (Radek Pazdera) """
-import logging import os -import re -import sys -from lxml import etree -from lnst.Common.Config import lnst_config -from lnst.Common.NetUtils import normalize_hwaddr -from lnst.Common.Utils import bool_it from lnst.Common.RecipePath import RecipePath from lnst.Controller.XmlParser import XmlParser from lnst.Controller.XmlProcessing import XmlProcessingError, XmlData from lnst.Controller.XmlProcessing import XmlCollection -from lnst.Controller.XmlTemplates import XmlTemplates, XmlTemplateError
class RecipeError(XmlProcessingError): pass diff --git a/lnst/Controller/SlaveMachineParser.py b/lnst/Controller/SlaveMachineParser.py index 1ec7ef7..1b87a89 100644 --- a/lnst/Controller/SlaveMachineParser.py +++ b/lnst/Controller/SlaveMachineParser.py @@ -11,10 +11,6 @@ __author__ = """ rpazdera@redhat.com (Radek Pazdera) """
-import logging -import os -import re -from lxml import etree from lnst.Controller.XmlParser import XmlParser from lnst.Controller.XmlProcessing import XmlProcessingError, XmlData from lnst.Controller.XmlProcessing import XmlCollection diff --git a/lnst/Controller/SlavePool.py b/lnst/Controller/SlavePool.py index 2fed8ad..c6b7883 100644 --- a/lnst/Controller/SlavePool.py +++ b/lnst/Controller/SlavePool.py @@ -16,14 +16,10 @@ rpazdera@redhat.com (Radek Pazdera) import logging import os import re -import copy import socket import select -from xml.dom import minidom from lnst.Common.Config import lnst_config from lnst.Common.NetUtils import normalize_hwaddr -from lnst.Common.NetUtils import test_tcp_connection -from lnst.Controller.XmlProcessing import XmlProcessingError, XmlData from lnst.Controller.Machine import Machine from lnst.Controller.SlaveMachineParser import SlaveMachineParser from lnst.Controller.SlaveMachineParser import SlaveMachineError diff --git a/lnst/Controller/Task.py b/lnst/Controller/Task.py index ccbd299..880ff73 100644 --- a/lnst/Controller/Task.py +++ b/lnst/Controller/Task.py @@ -14,8 +14,7 @@ import hashlib from lnst.Controller.PerfRepo import PerfRepoRESTAPI from lnst.Controller.PerfRepo import PerfRepoTestExecution from lnst.Controller.PerfRepo import PerfRepoValue -from lnst.Common.Utils import dot_to_dict, dict_to_dot, list_to_dot -from lnst.Common.Utils import recursive_dict_update +from lnst.Common.Utils import dict_to_dot, list_to_dot from lnst.Common.Config import lnst_config
# The handle to be imported from each task diff --git a/lnst/Controller/VirtUtils.py b/lnst/Controller/VirtUtils.py index 25a6f39..9d2a6ff 100644 --- a/lnst/Controller/VirtUtils.py +++ b/lnst/Controller/VirtUtils.py @@ -15,7 +15,7 @@ import logging import libvirt from libvirt import libvirtError from lnst.Common.ExecCmd import exec_cmd, ExecCmdFail -from lnst.Common.NetUtils import normalize_hwaddr, scan_netdevs +from lnst.Common.NetUtils import scan_netdevs
#this is a global object because opening the connection to libvirt in every #object instance that uses it sometimes fails - the libvirt server probably diff --git a/lnst/Controller/XmlParser.py b/lnst/Controller/XmlParser.py index a342cf4..afc2cda 100644 --- a/lnst/Controller/XmlParser.py +++ b/lnst/Controller/XmlParser.py @@ -13,12 +13,11 @@ rpazdera@redhat.com (Radek Pazdera) import os import re import sys -import logging import copy from lxml import etree from lnst.Common.Config import lnst_config -from lnst.Controller.XmlTemplates import XmlTemplates, XmlTemplateError -from lnst.Controller.XmlProcessing import XmlProcessingError, XmlData +from lnst.Controller.XmlTemplates import XmlTemplates +from lnst.Controller.XmlProcessing import XmlProcessingError
class XmlParser(object): XINCLUDE_RE = r"{http://www.w3.org/[0-9]{4}/XInclude}include" diff --git a/lnst/Controller/XmlProcessing.py b/lnst/Controller/XmlProcessing.py index 5da0289..b80c3a3 100644 --- a/lnst/Controller/XmlProcessing.py +++ b/lnst/Controller/XmlProcessing.py @@ -11,7 +11,6 @@ rpazdera@redhat.com (Radek Pazdera) """
import os -import logging
class XmlProcessingError(Exception): """ Exception thrown on parsing errors """ diff --git a/lnst/Slave/InterfaceManager.py b/lnst/Slave/InterfaceManager.py index ab7efcd..b2c2e20 100644 --- a/lnst/Slave/InterfaceManager.py +++ b/lnst/Slave/InterfaceManager.py @@ -12,7 +12,6 @@ __author__ = """ olichtne@redhat.com (Ondrej Lichtner) """
-import logging import re from lnst.Slave.NetConfigDevice import NetConfigDevice from lnst.Slave.NetConfigCommon import get_option diff --git a/lnst/Slave/NetConfigDevice.py b/lnst/Slave/NetConfigDevice.py index 6569410..fe16604 100644 --- a/lnst/Slave/NetConfigDevice.py +++ b/lnst/Slave/NetConfigDevice.py @@ -13,14 +13,11 @@ jpirko@redhat.com (Jiri Pirko)
import logging import re -import sys from lnst.Common.ExecCmd import exec_cmd from lnst.Slave.NetConfigCommon import get_slaves, get_option, get_slave_option, parse_netem -from lnst.Common.Utils import kmod_in_use, bool_it +from lnst.Common.Utils import bool_it from lnst.Slave.NmConfigDevice import type_class_mapping as nm_type_class_mapping from lnst.Slave.NmConfigDevice import is_nm_managed -from lnst.Common.Utils import check_process_running -from lnst.Common.Config import lnst_config
class NetConfigDeviceGeneric(object): diff --git a/lnst/Slave/NetTestSlave.py b/lnst/Slave/NetTestSlave.py index d186757..a67d547 100644 --- a/lnst/Slave/NetTestSlave.py +++ b/lnst/Slave/NetTestSlave.py @@ -12,12 +12,11 @@ jpirko@redhat.com (Jiri Pirko) """
import signal -import select, logging +import logging import os import sys, traceback import datetime import socket -import dbus import ctypes import multiprocessing from time import sleep, time @@ -26,20 +25,16 @@ from tempfile import NamedTemporaryFile from lnst.Common.Logs import log_exc_traceback from lnst.Common.PacketCapture import PacketCapture from lnst.Common.Utils import die_when_parent_die -from lnst.Common.NetUtils import scan_netdevs, test_tcp_connection -from lnst.Common.NetUtils import normalize_hwaddr from lnst.Common.ExecCmd import exec_cmd, ExecCmdFail from lnst.Common.ResourceCache import ResourceCache from lnst.Common.NetTestCommand import NetTestCommandContext -from lnst.Common.NetTestCommand import CommandException, NetTestCommand +from lnst.Common.NetTestCommand import NetTestCommand from lnst.Common.NetTestCommand import DEFAULT_TIMEOUT -from lnst.Slave.NmConfigDevice import is_nm_managed_by_name from lnst.Common.Utils import check_process_running -from lnst.Common.ConnectionHandler import recv_data, send_data +from lnst.Common.ConnectionHandler import send_data from lnst.Common.ConnectionHandler import ConnectionHandler from lnst.Common.Config import lnst_config from lnst.Common.Config import DefaultRPCPort -from lnst.Common.NetTestCommand import NetTestCommandConfig from lnst.Slave.InterfaceManager import InterfaceManager
class SlaveMethods: diff --git a/lnst/Slave/NmConfigDevice.py b/lnst/Slave/NmConfigDevice.py index 8e2f1dd..bc7e883 100644 --- a/lnst/Slave/NmConfigDevice.py +++ b/lnst/Slave/NmConfigDevice.py @@ -13,14 +13,12 @@ olicthne@redhat.com (Ondrej Lichtner)
import logging import re -import sys import dbus import uuid import socket, struct import time from lnst.Common.ExecCmd import exec_cmd from lnst.Slave.NetConfigCommon import get_slaves, get_option, get_slave_option, parse_netem -from lnst.Common.Utils import kmod_in_use, bool_it from lnst.Common.NetUtils import scan_netdevs from lnst.Common.Utils import check_process_running from lnst.Common.Config import lnst_config
Thu, Jun 25, 2015 at 03:27:27PM CEST, jprochaz@redhat.com wrote:
Removing all imports that Pylint has marked as unused
Signed-off-by: Jiri Prochazka jprochaz@redhat.com
lnst/Common/Colours.py | 2 -- lnst/Common/Config.py | 3 +-- lnst/Common/LoggingHandler.py | 2 +- lnst/Common/Logs.py | 3 +-- lnst/Common/NetTestCommand.py | 3 +-- lnst/Common/PacketCapture.py | 1 - lnst/Common/ResourceCache.py | 1 - lnst/Common/TestsCommon.py | 1 - lnst/Controller/Machine.py | 10 ++-------- lnst/Controller/MessageDispatcherLite.py | 2 +- lnst/Controller/NetTestController.py | 7 ++----- lnst/Controller/NetTestResultSerializer.py | 3 +-- lnst/Controller/PerfRepo.py | 1 - lnst/Controller/RecipeParser.py | 8 -------- lnst/Controller/SlaveMachineParser.py | 4 ---- lnst/Controller/SlavePool.py | 4 ---- lnst/Controller/Task.py | 3 +-- lnst/Controller/VirtUtils.py | 2 +- lnst/Controller/XmlParser.py | 5 ++--- lnst/Controller/XmlProcessing.py | 1 - lnst/Slave/InterfaceManager.py | 1 - lnst/Slave/NetConfigDevice.py | 5 +---- lnst/Slave/NetTestSlave.py | 11 +++-------- lnst/Slave/NmConfigDevice.py | 2 -- 24 files changed, 18 insertions(+), 67 deletions(-)
diff --git a/lnst/Common/Colours.py b/lnst/Common/Colours.py index 1b72d58..e57794e 100644 --- a/lnst/Common/Colours.py +++ b/lnst/Common/Colours.py @@ -10,8 +10,6 @@ __author__ = """ rpazdera@redhat.com (Radek Pazdera) """
-import logging -import os import re from lnst.Common.Utils import bool_it
diff --git a/lnst/Common/Config.py b/lnst/Common/Config.py index e6b600b..547dd99 100644 --- a/lnst/Common/Config.py +++ b/lnst/Common/Config.py @@ -12,11 +12,10 @@ olichtne@redhat.com (Ondrej Lichtner)
import os import sys -import logging import re from ConfigParser import ConfigParser from lnst.Common.Utils import bool_it -from lnst.Common.NetUtils import verify_ip_address, verify_mac_address +from lnst.Common.NetUtils import verify_mac_address from lnst.Common.Colours import get_preset_conf
DefaultRPCPort = 9999 diff --git a/lnst/Common/LoggingHandler.py b/lnst/Common/LoggingHandler.py index 22d58f5..a236922 100644 --- a/lnst/Common/LoggingHandler.py +++ b/lnst/Common/LoggingHandler.py @@ -14,7 +14,7 @@ __autor__ = """ olichtne@redhat.com (Ondrej Lichtner) """
-import socket, struct, pickle +import pickle import logging import xmlrpclib from lnst.Common.ConnectionHandler import send_data diff --git a/lnst/Common/Logs.py b/lnst/Common/Logs.py index 233f427..23aaf05 100644 --- a/lnst/Common/Logs.py +++ b/lnst/Common/Logs.py @@ -9,11 +9,10 @@ published by the Free Software Foundation; see COPYING for details. __autor__ = """ jzupka@redhat.com (Jiri Zupka) """ -import os, sys, shutil, datetime +import os, sys, shutil from logging import Formatter import logging.handlers import traceback -from lnst.Common.LoggingHandler import LogBuffer from lnst.Common.LoggingHandler import TransmitHandler from lnst.Common.Colours import decorate_with_preset, strip_colours
diff --git a/lnst/Common/NetTestCommand.py b/lnst/Common/NetTestCommand.py index f872a12..1e404bf 100644 --- a/lnst/Common/NetTestCommand.py +++ b/lnst/Common/NetTestCommand.py @@ -15,12 +15,11 @@ import os import sys import signal import imp -import pickle, traceback import multiprocessing import re from time import time from lnst.Common.ExecCmd import exec_cmd, ExecCmdFail -from lnst.Common.ConnectionHandler import recv_data, send_data +from lnst.Common.ConnectionHandler import send_data from lnst.Common.Logs import log_exc_traceback
DEFAULT_TIMEOUT = 60 diff --git a/lnst/Common/PacketCapture.py b/lnst/Common/PacketCapture.py index 69ad5cb..f45dc99 100644 --- a/lnst/Common/PacketCapture.py +++ b/lnst/Common/PacketCapture.py @@ -10,7 +10,6 @@ __author__ = """ rpazdera@redhat.com (Radek Pazdera) """
-import logging import subprocess
class PacketCapture: diff --git a/lnst/Common/ResourceCache.py b/lnst/Common/ResourceCache.py index 8719b09..98558a2 100644 --- a/lnst/Common/ResourceCache.py +++ b/lnst/Common/ResourceCache.py @@ -14,7 +14,6 @@ import os import re import time import shutil -from lnst.Common.Utils import md5sum from lnst.Common.ExecCmd import exec_cmd
SETUP_SCRIPT_NAME = "lnst-setup.sh" diff --git a/lnst/Common/TestsCommon.py b/lnst/Common/TestsCommon.py index b471d8d..e29a609 100644 --- a/lnst/Common/TestsCommon.py +++ b/lnst/Common/TestsCommon.py @@ -12,7 +12,6 @@ jpirko@redhat.com (Jiri Pirko)
import re import logging -import sys import os import signal import time diff --git a/lnst/Controller/Machine.py b/lnst/Controller/Machine.py index a7c5ea9..a0e786c 100644 --- a/lnst/Controller/Machine.py +++ b/lnst/Controller/Machine.py @@ -14,20 +14,14 @@ rpazdera@redhat.com (Radek Pazdera) import logging import socket import os -import re -import pickle import tempfile import signal from time import sleep from xmlrpclib import Binary -from pprint import pprint, pformat from lnst.Common.Config import lnst_config -from lnst.Common.Logs import log_exc_traceback -from lnst.Common.NetUtils import MacPool, normalize_hwaddr -from lnst.Common.Utils import wait_for, md5sum, dir_md5sum, create_tar_archive +from lnst.Common.NetUtils import normalize_hwaddr +from lnst.Common.Utils import wait_for, create_tar_archive from lnst.Common.Utils import check_process_running -from lnst.Common.ConnectionHandler import send_data, recv_data -from lnst.Common.ConnectionHandler import ConnectionHandler from lnst.Common.NetTestCommand import DEFAULT_TIMEOUT
# conditional support for libvirt diff --git a/lnst/Controller/MessageDispatcherLite.py b/lnst/Controller/MessageDispatcherLite.py index e86c077..2973763 100644 --- a/lnst/Controller/MessageDispatcherLite.py +++ b/lnst/Controller/MessageDispatcherLite.py @@ -11,7 +11,7 @@ __author__ = """ jpirko@redhat.com (Jiri Pirko) """
-from lnst.Common.ConnectionHandler import send_data, recv_data +from lnst.Common.ConnectionHandler import send_data from lnst.Common.ConnectionHandler import ConnectionHandler from lnst.Controller.NetTestController import NetTestError
diff --git a/lnst/Controller/NetTestController.py b/lnst/Controller/NetTestController.py index 0791897..e12d349 100644 --- a/lnst/Controller/NetTestController.py +++ b/lnst/Controller/NetTestController.py @@ -16,20 +16,17 @@ import socket import os import re import cPickle -import tempfile import imp import copy import sys from time import sleep -from xmlrpclib import Binary from lnst.Common.NetUtils import MacPool -from lnst.Common.Utils import wait_for, md5sum, dir_md5sum, create_tar_archive +from lnst.Common.Utils import md5sum, dir_md5sum from lnst.Common.Utils import check_process_running, bool_it, get_module_tools -from lnst.Common.NetTestCommand import NetTestCommandContext, NetTestCommand 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 Machine, MachineError, VirtualInterface +from lnst.Controller.Machine import MachineError, VirtualInterface from lnst.Common.ConnectionHandler import send_data, recv_data from lnst.Common.ConnectionHandler import ConnectionHandler from lnst.Common.Config import lnst_config diff --git a/lnst/Controller/NetTestResultSerializer.py b/lnst/Controller/NetTestResultSerializer.py index 49f632c..3650981 100644 --- a/lnst/Controller/NetTestResultSerializer.py +++ b/lnst/Controller/NetTestResultSerializer.py @@ -14,8 +14,7 @@ jpirko@redhat.com (Jiri Pirko) import logging import datetime from xml.dom.minidom import getDOMImplementation -from lnst.Common.NetTestCommand import str_command -from lnst.Common.Colours import decorate_string, decorate_with_preset +from lnst.Common.Colours import decorate_with_preset from lnst.Common.Config import lnst_config from lxml import etree
diff --git a/lnst/Controller/PerfRepo.py b/lnst/Controller/PerfRepo.py index ffc29d5..4ba0147 100644 --- a/lnst/Controller/PerfRepo.py +++ b/lnst/Controller/PerfRepo.py @@ -11,7 +11,6 @@ olichtne@redhat.com (Ondrej Lichtner) """
import requests -import collections import datetime import re from types import StringType, NoneType diff --git a/lnst/Controller/RecipeParser.py b/lnst/Controller/RecipeParser.py index 73422f1..0f35581 100644 --- a/lnst/Controller/RecipeParser.py +++ b/lnst/Controller/RecipeParser.py @@ -10,19 +10,11 @@ __author__ = """ rpazdera@redhat.com (Radek Pazdera) """
-import logging import os -import re -import sys -from lxml import etree -from lnst.Common.Config import lnst_config -from lnst.Common.NetUtils import normalize_hwaddr -from lnst.Common.Utils import bool_it from lnst.Common.RecipePath import RecipePath from lnst.Controller.XmlParser import XmlParser from lnst.Controller.XmlProcessing import XmlProcessingError, XmlData from lnst.Controller.XmlProcessing import XmlCollection -from lnst.Controller.XmlTemplates import XmlTemplates, XmlTemplateError
class RecipeError(XmlProcessingError): pass diff --git a/lnst/Controller/SlaveMachineParser.py b/lnst/Controller/SlaveMachineParser.py index 1ec7ef7..1b87a89 100644 --- a/lnst/Controller/SlaveMachineParser.py +++ b/lnst/Controller/SlaveMachineParser.py @@ -11,10 +11,6 @@ __author__ = """ rpazdera@redhat.com (Radek Pazdera) """
-import logging -import os -import re -from lxml import etree from lnst.Controller.XmlParser import XmlParser from lnst.Controller.XmlProcessing import XmlProcessingError, XmlData from lnst.Controller.XmlProcessing import XmlCollection diff --git a/lnst/Controller/SlavePool.py b/lnst/Controller/SlavePool.py index 2fed8ad..c6b7883 100644 --- a/lnst/Controller/SlavePool.py +++ b/lnst/Controller/SlavePool.py @@ -16,14 +16,10 @@ rpazdera@redhat.com (Radek Pazdera) import logging import os import re -import copy import socket import select -from xml.dom import minidom from lnst.Common.Config import lnst_config from lnst.Common.NetUtils import normalize_hwaddr -from lnst.Common.NetUtils import test_tcp_connection -from lnst.Controller.XmlProcessing import XmlProcessingError, XmlData from lnst.Controller.Machine import Machine from lnst.Controller.SlaveMachineParser import SlaveMachineParser from lnst.Controller.SlaveMachineParser import SlaveMachineError diff --git a/lnst/Controller/Task.py b/lnst/Controller/Task.py index ccbd299..880ff73 100644 --- a/lnst/Controller/Task.py +++ b/lnst/Controller/Task.py @@ -14,8 +14,7 @@ import hashlib from lnst.Controller.PerfRepo import PerfRepoRESTAPI from lnst.Controller.PerfRepo import PerfRepoTestExecution from lnst.Controller.PerfRepo import PerfRepoValue -from lnst.Common.Utils import dot_to_dict, dict_to_dot, list_to_dot -from lnst.Common.Utils import recursive_dict_update +from lnst.Common.Utils import dict_to_dot, list_to_dot from lnst.Common.Config import lnst_config
# The handle to be imported from each task diff --git a/lnst/Controller/VirtUtils.py b/lnst/Controller/VirtUtils.py index 25a6f39..9d2a6ff 100644 --- a/lnst/Controller/VirtUtils.py +++ b/lnst/Controller/VirtUtils.py @@ -15,7 +15,7 @@ import logging import libvirt from libvirt import libvirtError from lnst.Common.ExecCmd import exec_cmd, ExecCmdFail -from lnst.Common.NetUtils import normalize_hwaddr, scan_netdevs +from lnst.Common.NetUtils import scan_netdevs
#this is a global object because opening the connection to libvirt in every #object instance that uses it sometimes fails - the libvirt server probably diff --git a/lnst/Controller/XmlParser.py b/lnst/Controller/XmlParser.py index a342cf4..afc2cda 100644 --- a/lnst/Controller/XmlParser.py +++ b/lnst/Controller/XmlParser.py @@ -13,12 +13,11 @@ rpazdera@redhat.com (Radek Pazdera) import os import re import sys -import logging import copy from lxml import etree from lnst.Common.Config import lnst_config -from lnst.Controller.XmlTemplates import XmlTemplates, XmlTemplateError -from lnst.Controller.XmlProcessing import XmlProcessingError, XmlData +from lnst.Controller.XmlTemplates import XmlTemplates +from lnst.Controller.XmlProcessing import XmlProcessingError
class XmlParser(object): XINCLUDE_RE = r"{http://www.w3.org/[0-9]{4}/XInclude}include" diff --git a/lnst/Controller/XmlProcessing.py b/lnst/Controller/XmlProcessing.py index 5da0289..b80c3a3 100644 --- a/lnst/Controller/XmlProcessing.py +++ b/lnst/Controller/XmlProcessing.py @@ -11,7 +11,6 @@ rpazdera@redhat.com (Radek Pazdera) """
import os -import logging
class XmlProcessingError(Exception): """ Exception thrown on parsing errors """ diff --git a/lnst/Slave/InterfaceManager.py b/lnst/Slave/InterfaceManager.py index ab7efcd..b2c2e20 100644 --- a/lnst/Slave/InterfaceManager.py +++ b/lnst/Slave/InterfaceManager.py @@ -12,7 +12,6 @@ __author__ = """ olichtne@redhat.com (Ondrej Lichtner) """
-import logging import re from lnst.Slave.NetConfigDevice import NetConfigDevice from lnst.Slave.NetConfigCommon import get_option diff --git a/lnst/Slave/NetConfigDevice.py b/lnst/Slave/NetConfigDevice.py index 6569410..fe16604 100644 --- a/lnst/Slave/NetConfigDevice.py +++ b/lnst/Slave/NetConfigDevice.py @@ -13,14 +13,11 @@ jpirko@redhat.com (Jiri Pirko)
import logging import re -import sys from lnst.Common.ExecCmd import exec_cmd from lnst.Slave.NetConfigCommon import get_slaves, get_option, get_slave_option, parse_netem -from lnst.Common.Utils import kmod_in_use, bool_it +from lnst.Common.Utils import bool_it from lnst.Slave.NmConfigDevice import type_class_mapping as nm_type_class_mapping from lnst.Slave.NmConfigDevice import is_nm_managed -from lnst.Common.Utils import check_process_running -from lnst.Common.Config import lnst_config
class NetConfigDeviceGeneric(object): diff --git a/lnst/Slave/NetTestSlave.py b/lnst/Slave/NetTestSlave.py index d186757..a67d547 100644 --- a/lnst/Slave/NetTestSlave.py +++ b/lnst/Slave/NetTestSlave.py @@ -12,12 +12,11 @@ jpirko@redhat.com (Jiri Pirko) """
import signal -import select, logging +import logging import os import sys, traceback import datetime import socket -import dbus import ctypes import multiprocessing from time import sleep, time @@ -26,20 +25,16 @@ from tempfile import NamedTemporaryFile from lnst.Common.Logs import log_exc_traceback from lnst.Common.PacketCapture import PacketCapture from lnst.Common.Utils import die_when_parent_die -from lnst.Common.NetUtils import scan_netdevs, test_tcp_connection -from lnst.Common.NetUtils import normalize_hwaddr from lnst.Common.ExecCmd import exec_cmd, ExecCmdFail from lnst.Common.ResourceCache import ResourceCache from lnst.Common.NetTestCommand import NetTestCommandContext -from lnst.Common.NetTestCommand import CommandException, NetTestCommand +from lnst.Common.NetTestCommand import NetTestCommand from lnst.Common.NetTestCommand import DEFAULT_TIMEOUT -from lnst.Slave.NmConfigDevice import is_nm_managed_by_name from lnst.Common.Utils import check_process_running -from lnst.Common.ConnectionHandler import recv_data, send_data +from lnst.Common.ConnectionHandler import send_data from lnst.Common.ConnectionHandler import ConnectionHandler from lnst.Common.Config import lnst_config from lnst.Common.Config import DefaultRPCPort -from lnst.Common.NetTestCommand import NetTestCommandConfig from lnst.Slave.InterfaceManager import InterfaceManager
class SlaveMethods: diff --git a/lnst/Slave/NmConfigDevice.py b/lnst/Slave/NmConfigDevice.py index 8e2f1dd..bc7e883 100644 --- a/lnst/Slave/NmConfigDevice.py +++ b/lnst/Slave/NmConfigDevice.py @@ -13,14 +13,12 @@ olicthne@redhat.com (Ondrej Lichtner)
import logging import re -import sys import dbus import uuid import socket, struct import time from lnst.Common.ExecCmd import exec_cmd from lnst.Slave.NetConfigCommon import get_slaves, get_option, get_slave_option, parse_netem -from lnst.Common.Utils import kmod_in_use, bool_it from lnst.Common.NetUtils import scan_netdevs from lnst.Common.Utils import check_process_running from lnst.Common.Config import lnst_config -- 2.4.3
LNST-developers mailing list LNST-developers@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/lnst-developers
Acked-by: Jan Tluka jtluka@redhat.com
On Thu, Jun 25, 2015 at 03:27:27PM +0200, Jiri Prochazka wrote:
Removing all imports that Pylint has marked as unused
Signed-off-by: Jiri Prochazka jprochaz@redhat.com
Acked-by: Ondrej Lichtner olichtne@redhat.com
Thu, Jun 25, 2015 at 03:27:27PM CEST, jprochaz@redhat.com wrote:
Removing all imports that Pylint has marked as unused
Signed-off-by: Jiri Prochazka jprochaz@redhat.com
applied, thanks.
Thu, Jun 25, 2015 at 03:27:26PM CEST, jprochaz@redhat.com wrote:
For issue #111. Since RPC connection is created after mapping, we can't get interface driver info sooner without creating extra connection to the Slave. This patch stores driver info after device configuration, after method interface_update() was called, so driver info should be present in Slave.
Signed-off-by: Jiri Prochazka jprochaz@redhat.com
lnst/Controller/NetTestController.py | 5 +++++ lnst/Controller/NetTestResultSerializer.py | 14 +++++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/lnst/Controller/NetTestController.py b/lnst/Controller/NetTestController.py index 5c2695d..0791897 100644 --- a/lnst/Controller/NetTestController.py +++ b/lnst/Controller/NetTestController.py @@ -204,6 +204,11 @@ class NetTestController:
for iface in ifaces: iface.configure()
if m._libvirt_domain is None:
driver = iface._driver
if_id = iface._id
mapped_machine = self._slave_pool._map['machines'][m_id]
mapped_machine['interfaces'][if_id]['driver'] = driver for iface in ifaces: iface.up()
Jirko, why you limit this to non-virt environment. Is this not working with virtio devices?
diff --git a/lnst/Controller/NetTestResultSerializer.py b/lnst/Controller/NetTestResultSerializer.py index 9f8955a..49f632c 100644 --- a/lnst/Controller/NetTestResultSerializer.py +++ b/lnst/Controller/NetTestResultSerializer.py @@ -100,9 +100,17 @@ class NetTestResultSerializer: (m_id, m["target"]), "")) for if_id, pool_if in m["interfaces"].iteritems(): pool_id = pool_if["target"]
output_pairs.append((6*" " + "interface \"%s\" "\
"matched to \"%s\"" %\
(if_id, pool_id), ""))
if "driver" in pool_if:
driver = pool_if["driver"]
output_pairs.append((6*" " + "interface \"%s\" "
"matched to \"%s\" "
"(driver: \"%s\")" %
(if_id, pool_id,
driver), ""))
else:
output_pairs.append((6*" " + "interface \"%s\" "
"matched to \"%s\" " %
(if_id, pool_id), "")) if recipe["result"] == "FAIL" and \ "err_msg" in recipe and recipe["err_msg"] != "":
-- 2.4.3
LNST-developers mailing list LNST-developers@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/lnst-developers
On 06/29/2015 10:27 AM, Jan Tluka wrote:
Thu, Jun 25, 2015 at 03:27:26PM CEST, jprochaz@redhat.com wrote:
For issue #111. Since RPC connection is created after mapping, we can't get interface driver info sooner without creating extra connection to the Slave. This patch stores driver info after device configuration, after method interface_update() was called, so driver info should be present in Slave.
Signed-off-by: Jiri Prochazka jprochaz@redhat.com
lnst/Controller/NetTestController.py | 5 +++++ lnst/Controller/NetTestResultSerializer.py | 14 +++++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/lnst/Controller/NetTestController.py b/lnst/Controller/NetTestController.py index 5c2695d..0791897 100644 --- a/lnst/Controller/NetTestController.py +++ b/lnst/Controller/NetTestController.py @@ -204,6 +204,11 @@ class NetTestController:
for iface in ifaces: iface.configure()
if m._libvirt_domain is None:
driver = iface._driver
if_id = iface._id
mapped_machine = self._slave_pool._map['machines'][m_id]
mapped_machine['interfaces'][if_id]['driver'] = driver for iface in ifaces: iface.up()
Jirko, why you limit this to non-virt environment. Is this not working with virtio devices?
Yes, when using virtual machines, no interfaces are defined in Slave machine config (since they are created dynamically) and trying to save driver info in SlavePool map results in KeyError exception.
diff --git a/lnst/Controller/NetTestResultSerializer.py b/lnst/Controller/NetTestResultSerializer.py index 9f8955a..49f632c 100644 --- a/lnst/Controller/NetTestResultSerializer.py +++ b/lnst/Controller/NetTestResultSerializer.py @@ -100,9 +100,17 @@ class NetTestResultSerializer: (m_id, m["target"]), "")) for if_id, pool_if in m["interfaces"].iteritems(): pool_id = pool_if["target"]
output_pairs.append((6*" " + "interface \"%s\" "\
"matched to \"%s\"" %\
(if_id, pool_id), ""))
if "driver" in pool_if:
driver = pool_if["driver"]
output_pairs.append((6*" " + "interface \"%s\" "
"matched to \"%s\" "
"(driver: \"%s\")" %
(if_id, pool_id,
driver), ""))
else:
output_pairs.append((6*" " + "interface \"%s\" "
"matched to \"%s\" " %
(if_id, pool_id), "")) if recipe["result"] == "FAIL" and \ "err_msg" in recipe and recipe["err_msg"] != "":
-- 2.4.3
LNST-developers mailing list LNST-developers@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/lnst-developers
LNST-developers mailing list LNST-developers@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/lnst-developers
Thu, Jun 25, 2015 at 03:27:26PM CEST, jprochaz@redhat.com wrote:
For issue #111. Since RPC connection is created after mapping, we can't get interface driver info sooner without creating extra connection to the Slave. This patch stores driver info after device configuration, after method interface_update() was called, so driver info should be present in Slave.
Btw, if you enter something like "Fixes #111" in the description then github will automagically close the issue for you, see [1].
And one more thing. Please, please, please, describe what you're fixing, patching, enhancing as first, then include github related data like reference to issue, e.g. this post [2].
[1] https://help.github.com/articles/closing-issues-via-commit-messages/ [2] https://lists.fedorahosted.org/pipermail/lnst-developers/2015-June/002901.ht...
Thanks, Jan
Signed-off-by: Jiri Prochazka jprochaz@redhat.com
lnst/Controller/NetTestController.py | 5 +++++ lnst/Controller/NetTestResultSerializer.py | 14 +++++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/lnst/Controller/NetTestController.py b/lnst/Controller/NetTestController.py index 5c2695d..0791897 100644 --- a/lnst/Controller/NetTestController.py +++ b/lnst/Controller/NetTestController.py @@ -204,6 +204,11 @@ class NetTestController:
for iface in ifaces: iface.configure()
if m._libvirt_domain is None:
driver = iface._driver
if_id = iface._id
mapped_machine = self._slave_pool._map['machines'][m_id]
mapped_machine['interfaces'][if_id]['driver'] = driver for iface in ifaces: iface.up()
diff --git a/lnst/Controller/NetTestResultSerializer.py b/lnst/Controller/NetTestResultSerializer.py index 9f8955a..49f632c 100644 --- a/lnst/Controller/NetTestResultSerializer.py +++ b/lnst/Controller/NetTestResultSerializer.py @@ -100,9 +100,17 @@ class NetTestResultSerializer: (m_id, m["target"]), "")) for if_id, pool_if in m["interfaces"].iteritems(): pool_id = pool_if["target"]
output_pairs.append((6*" " + "interface \"%s\" "\
"matched to \"%s\"" %\
(if_id, pool_id), ""))
if "driver" in pool_if:
driver = pool_if["driver"]
output_pairs.append((6*" " + "interface \"%s\" "
"matched to \"%s\" "
"(driver: \"%s\")" %
(if_id, pool_id,
driver), ""))
else:
output_pairs.append((6*" " + "interface \"%s\" "
"matched to \"%s\" " %
(if_id, pool_id), "")) if recipe["result"] == "FAIL" and \ "err_msg" in recipe and recipe["err_msg"] != "":
-- 2.4.3
LNST-developers mailing list LNST-developers@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/lnst-developers
On 06/29/2015 10:35 AM, Jan Tluka wrote:
Thu, Jun 25, 2015 at 03:27:26PM CEST, jprochaz@redhat.com wrote:
For issue #111. Since RPC connection is created after mapping, we can't get interface driver info sooner without creating extra connection to the Slave. This patch stores driver info after device configuration, after method interface_update() was called, so driver info should be present in Slave.
Btw, if you enter something like "Fixes #111" in the description then github will automagically close the issue for you, see [1].
And one more thing. Please, please, please, describe what you're fixing, patching, enhancing as first, then include github related data like reference to issue, e.g. this post [2].
[1] https://help.github.com/articles/closing-issues-via-commit-messages/ [2] https://lists.fedorahosted.org/pipermail/lnst-developers/2015-June/002901.ht...
Thanks, Jan
Acknowledged, thanks for the feedback.
Signed-off-by: Jiri Prochazka jprochaz@redhat.com
lnst/Controller/NetTestController.py | 5 +++++ lnst/Controller/NetTestResultSerializer.py | 14 +++++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/lnst/Controller/NetTestController.py b/lnst/Controller/NetTestController.py index 5c2695d..0791897 100644 --- a/lnst/Controller/NetTestController.py +++ b/lnst/Controller/NetTestController.py @@ -204,6 +204,11 @@ class NetTestController:
for iface in ifaces: iface.configure()
if m._libvirt_domain is None:
driver = iface._driver
if_id = iface._id
mapped_machine = self._slave_pool._map['machines'][m_id]
mapped_machine['interfaces'][if_id]['driver'] = driver for iface in ifaces: iface.up()
diff --git a/lnst/Controller/NetTestResultSerializer.py b/lnst/Controller/NetTestResultSerializer.py index 9f8955a..49f632c 100644 --- a/lnst/Controller/NetTestResultSerializer.py +++ b/lnst/Controller/NetTestResultSerializer.py @@ -100,9 +100,17 @@ class NetTestResultSerializer: (m_id, m["target"]), "")) for if_id, pool_if in m["interfaces"].iteritems(): pool_id = pool_if["target"]
output_pairs.append((6*" " + "interface \"%s\" "\
"matched to \"%s\"" %\
(if_id, pool_id), ""))
if "driver" in pool_if:
driver = pool_if["driver"]
output_pairs.append((6*" " + "interface \"%s\" "
"matched to \"%s\" "
"(driver: \"%s\")" %
(if_id, pool_id,
driver), ""))
else:
output_pairs.append((6*" " + "interface \"%s\" "
"matched to \"%s\" " %
(if_id, pool_id), "")) if recipe["result"] == "FAIL" and \ "err_msg" in recipe and recipe["err_msg"] != "":
-- 2.4.3
LNST-developers mailing list LNST-developers@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/lnst-developers
LNST-developers mailing list LNST-developers@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/lnst-developers
On Thu, Jun 25, 2015 at 03:27:26PM +0200, Jiri Prochazka wrote:
For issue #111. Since RPC connection is created after mapping, we can't get interface driver info sooner without creating extra connection to the Slave. This patch stores driver info after device configuration, after method interface_update() was called, so driver info should be present in Slave.
Signed-off-by: Jiri Prochazka jprochaz@redhat.com
I think we'll be able to do this a bit better, don't close the issue so we can keep tracking this. Otherwise:
Acked-by: Ondrej Lichtner olichtne@redhat.com
Thu, Jun 25, 2015 at 03:27:26PM CEST, jprochaz@redhat.com wrote:
For issue #111. Since RPC connection is created after mapping, we can't get interface driver info sooner without creating extra connection to the Slave. This patch stores driver info after device configuration, after method interface_update() was called, so driver info should be present in Slave.
Signed-off-by: Jiri Prochazka jprochaz@redhat.com
Acked-by: Jan Tluka jtluka@redhat.com
lnst/Controller/NetTestController.py | 5 +++++ lnst/Controller/NetTestResultSerializer.py | 14 +++++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/lnst/Controller/NetTestController.py b/lnst/Controller/NetTestController.py index 5c2695d..0791897 100644 --- a/lnst/Controller/NetTestController.py +++ b/lnst/Controller/NetTestController.py @@ -204,6 +204,11 @@ class NetTestController:
for iface in ifaces: iface.configure()
if m._libvirt_domain is None:
driver = iface._driver
if_id = iface._id
mapped_machine = self._slave_pool._map['machines'][m_id]
mapped_machine['interfaces'][if_id]['driver'] = driver for iface in ifaces: iface.up()
diff --git a/lnst/Controller/NetTestResultSerializer.py b/lnst/Controller/NetTestResultSerializer.py index 9f8955a..49f632c 100644 --- a/lnst/Controller/NetTestResultSerializer.py +++ b/lnst/Controller/NetTestResultSerializer.py @@ -100,9 +100,17 @@ class NetTestResultSerializer: (m_id, m["target"]), "")) for if_id, pool_if in m["interfaces"].iteritems(): pool_id = pool_if["target"]
output_pairs.append((6*" " + "interface \"%s\" "\
"matched to \"%s\"" %\
(if_id, pool_id), ""))
if "driver" in pool_if:
driver = pool_if["driver"]
output_pairs.append((6*" " + "interface \"%s\" "
"matched to \"%s\" "
"(driver: \"%s\")" %
(if_id, pool_id,
driver), ""))
else:
output_pairs.append((6*" " + "interface \"%s\" "
"matched to \"%s\" " %
(if_id, pool_id), "")) if recipe["result"] == "FAIL" and \ "err_msg" in recipe and recipe["err_msg"] != "":
-- 2.4.3
LNST-developers mailing list LNST-developers@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/lnst-developers
Thu, Jun 25, 2015 at 03:27:26PM CEST, jprochaz@redhat.com wrote:
For issue #111. Since RPC connection is created after mapping, we can't get interface driver info sooner without creating extra connection to the Slave. This patch stores driver info after device configuration, after method interface_update() was called, so driver info should be present in Slave.
Signed-off-by: Jiri Prochazka jprochaz@redhat.com
applied, thanks.
lnst-developers@lists.fedorahosted.org