[lnst: 6/6] Cover letter for "PerfRepo support"
by Jiří Pírko
commit 8b7d6bf386272ff3f677a48f8fa55d2d048395d8
Merge: f56fc9e 3b11e39
Author: Jiri Pirko <jiri(a)resnulli.us>
Date: Fri Apr 17 15:40:04 2015 +0200
Cover letter for "PerfRepo support"
Ondrej says:
The following set of patches implements basic support for talking to PerfRepo.
There still are some placeholders for functions that are not important for now
and bugs are to be expected.
There is a short example work flow example in the last patch of the set but you
still need to have a PerfRepo instance available to try everything out, I'll be
sending a follow-up email to interested parties that will explain in more detail
how to try this out.
Any comments and ideas are always welcome.
lnst/Common/Utils.py | 52 +++
lnst/Controller/NetTestController.py | 3 +-
lnst/Controller/NetTestResultSerializer.py | 3 +-
lnst/Controller/PerfRepo.py | 532 ++++++++++++++++++++++++++++
lnst/Controller/SlavePool.py | 17 +-
lnst/Controller/Task.py | 127 +++++++
6 files changed, 728 insertions(+), 6 deletions(-)
---
8 years, 7 months
[PATCH 1/2] Fix "Undefined variable 'netdev'"
by Jiri Prochazka
Found with pylint. Typo in getting hwaddr from config.
Signed-off-by: Jiri Prochazka <jprochaz(a)redhat.com>
---
lnst/Slave/InterfaceManager.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lnst/Slave/InterfaceManager.py b/lnst/Slave/InterfaceManager.py
index de2042d..b2bb92e 100644
--- a/lnst/Slave/InterfaceManager.py
+++ b/lnst/Slave/InterfaceManager.py
@@ -228,7 +228,7 @@ class InterfaceManager(object):
if (not "hwaddr" in config or
"name" in config):
return
- hwaddr = normalize_hwaddr(netdev["hwaddr"])
+ hwaddr = normalize_hwaddr(config["hwaddr"])
for dev in self._devices:
if dev.get_hwaddr() == hwaddr:
return dev.get_name()
--
2.1.0
8 years, 7 months
[lnst] Fix bug in add_master
by Jiří Pírko
commit cd9d4d1d5ecf1b786b79505fe6aad85cd1ec4f06
Author: Jiri Prochazka <jprochaz(a)redhat.com>
Date: Tue Apr 21 15:39:13 2015 +0200
Fix bug in add_master
I made mistake when fixing bug in commit 6f7b3035156e94cd0d9fd09070dc821f743385aa
This patch fixed my mistake, now it should be working correctly
Signed-off-by: Jiri Prochazka <jprochaz(a)redhat.com>
Signed-off-by: Jiri Pirko <jiri(a)resnulli.us>
lnst/Controller/Machine.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/lnst/Controller/Machine.py b/lnst/Controller/Machine.py
index 6d791ae..e303c1a 100644
--- a/lnst/Controller/Machine.py
+++ b/lnst/Controller/Machine.py
@@ -553,7 +553,7 @@ class Interface(object):
def add_master(self, master, primary=True):
if primary and self._master["primary"] != None:
msg = "Interface %s already has a primary master."\
- % self._master["primary"].get_id()
+ % self.get_id()
raise MachineError(msg)
else:
if primary:
8 years, 7 months
[lnst] Fix "Undefined variable 'netdev'"
by Jiří Pírko
commit 2c6d9e8fb0ec2b4ddb0655bf0b3a3af382602dde
Author: Jiri Prochazka <jprochaz(a)redhat.com>
Date: Tue Apr 21 15:39:12 2015 +0200
Fix "Undefined variable 'netdev'"
Found with pylint. Typo in getting hwaddr from config.
Signed-off-by: Jiri Prochazka <jprochaz(a)redhat.com>
Signed-off-by: Jiri Pirko <jiri(a)resnulli.us>
lnst/Slave/InterfaceManager.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/lnst/Slave/InterfaceManager.py b/lnst/Slave/InterfaceManager.py
index de2042d..b2bb92e 100644
--- a/lnst/Slave/InterfaceManager.py
+++ b/lnst/Slave/InterfaceManager.py
@@ -228,7 +228,7 @@ class InterfaceManager(object):
if (not "hwaddr" in config or
"name" in config):
return
- hwaddr = normalize_hwaddr(netdev["hwaddr"])
+ hwaddr = normalize_hwaddr(config["hwaddr"])
for dev in self._devices:
if dev.get_hwaddr() == hwaddr:
return dev.get_name()
8 years, 7 months
[lnst] Fix "Undefined variable 'comapator'"
by Jiří Pírko
commit 82fcce19e7a883d12147e325ce2244c3cb0a94c5
Author: Jiri Prochazka <jprochaz(a)redhat.com>
Date: Tue Apr 21 15:10:50 2015 +0200
Fix "Undefined variable 'comapator'"
Found with pylint. Fix typo in PerfRepo module.
Signed-off-by: Jiri Prochazka <jprochaz(a)redhat.com>
Signed-off-by: Jiri Pirko <jiri(a)resnulli.us>
lnst/Controller/PerfRepo.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/lnst/Controller/PerfRepo.py b/lnst/Controller/PerfRepo.py
index 399f9d5..21d1eaa 100644
--- a/lnst/Controller/PerfRepo.py
+++ b/lnst/Controller/PerfRepo.py
@@ -347,7 +347,7 @@ class PerfRepoMetric(PerfRepoObject):
self._description = description
def set_comparator(self, comparator):
- if comapator not in ["HB", "LB"]:
+ if comparator not in ["HB", "LB"]:
raise PerfRepoException("Invalid comparator value.")
self._comparator = comparator
8 years, 7 months
[lnst] Fix "Instance of 'UnusedInterface' has no 'set_driver' member (but some types could not be inferred)
by Jiří Pírko
commit e0e87362bad2ec2f1eee95382ade5a94ea83b0be
Author: Jiri Prochazka <jprochaz(a)redhat.com>
Date: Tue Apr 21 15:10:49 2015 +0200
Fix "Instance of 'UnusedInterface' has no 'set_driver' member (but some types could not be inferred)"
Found with pylint. Add dummy set_driver method to UnusedInterface class
Signed-off-by: Jiri Prochazka <jprochaz(a)redhat.com>
Signed-off-by: Jiri Pirko <jiri(a)resnulli.us>
lnst/Controller/Machine.py | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/lnst/Controller/Machine.py b/lnst/Controller/Machine.py
index 1671e52..6d791ae 100644
--- a/lnst/Controller/Machine.py
+++ b/lnst/Controller/Machine.py
@@ -951,6 +951,9 @@ class UnusedInterface(Interface):
def initialize(self):
self._machine._rpc_call('set_unmapped_device_down', self._hwaddr)
+ def set_driver(self, driver):
+ pass
+
def configure(self):
pass
8 years, 7 months
[lnst] Fix "Undefined variable 'PrefixMissingError'"
by Jiří Pírko
commit 98b040f90d0f70aec899196b6675e558f9f032cd
Author: Jiri Prochazka <jprochaz(a)redhat.com>
Date: Tue Apr 21 15:10:48 2015 +0200
Fix "Undefined variable 'PrefixMissingError'"
Found with pylint. Exception class PrefixMissingError was not imported from Machine.py module
Signed-off-by: Jiri Prochazka <jprochaz(a)redhat.com>
Signed-off-by: Jiri Pirko <jiri(a)resnulli.us>
lnst/Controller/XmlTemplates.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/lnst/Controller/XmlTemplates.py b/lnst/Controller/XmlTemplates.py
index 8beec9f..e4577cb 100644
--- a/lnst/Controller/XmlTemplates.py
+++ b/lnst/Controller/XmlTemplates.py
@@ -24,7 +24,7 @@ rpazdera(a)redhat.com (Radek Pazdera)
import re
from lxml import etree
from lnst.Controller.XmlProcessing import XmlTemplateString
-from lnst.Controller.Machine import MachineError
+from lnst.Controller.Machine import MachineError, PrefixMissingError
class XmlTemplateError(Exception):
pass
8 years, 7 months
[lnst] Fix "Instance of 'dict' has no 'get_id' member" error
by Jiří Pírko
commit 6f7b3035156e94cd0d9fd09070dc821f743385aa
Author: Jiri Prochazka <jprochaz(a)redhat.com>
Date: Tue Apr 21 15:10:47 2015 +0200
Fix "Instance of 'dict' has no 'get_id' member" error
Found with pylint. This needs to be verified by original author of method, olichtne.
Probably method get_id should be called on the master inferface,
which is accessed by self._master['primary'] and not by self._master
Signed-off-by: Jiri Prochazka <jprochaz(a)redhat.com>
Signed-off-by: Jiri Pirko <jiri(a)resnulli.us>
lnst/Controller/Machine.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/lnst/Controller/Machine.py b/lnst/Controller/Machine.py
index 8da1a10..1671e52 100644
--- a/lnst/Controller/Machine.py
+++ b/lnst/Controller/Machine.py
@@ -553,7 +553,7 @@ class Interface(object):
def add_master(self, master, primary=True):
if primary and self._master["primary"] != None:
msg = "Interface %s already has a primary master."\
- % self._master.get_id()
+ % self._master["primary"].get_id()
raise MachineError(msg)
else:
if primary:
8 years, 7 months
[lnst] Fix "Raising a new style class which doesn't inherit from BaseException" error
by Jiří Pírko
commit 2b08645ec03dcd2322f54f53a6ad404a01dccb39
Author: Jiri Prochazka <jprochaz(a)redhat.com>
Date: Tue Apr 21 15:10:46 2015 +0200
Fix "Raising a new style class which doesn't inherit from BaseException" error
Found with pylint. Fixed typo in raise command, raise should use MachineError and not Machine.
Signed-off-by: Jiri Prochazka <jprochaz(a)redhat.com>
Signed-off-by: Jiri Pirko <jiri(a)resnulli.us>
lnst/Controller/Machine.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/lnst/Controller/Machine.py b/lnst/Controller/Machine.py
index 783d357..8da1a10 100644
--- a/lnst/Controller/Machine.py
+++ b/lnst/Controller/Machine.py
@@ -184,7 +184,7 @@ class Machine(object):
if hello != "hello":
msg = "Unable to establish RPC connection " \
"to machine %s, handshake failed!" % hostname
- raise Machine(msg)
+ raise MachineError(msg)
for iface in self._interfaces:
iface.initialize()
8 years, 7 months
[lnst] Fix "Undefined variable 'HTTPError'" error
by Jiří Pírko
commit 6c5c65c95e25835858545e42d5dbebf55017ad99
Author: Jiri Prochazka <jprochaz(a)redhat.com>
Date: Tue Apr 21 15:10:45 2015 +0200
Fix "Undefined variable 'HTTPError'" error
Found with pylint. Fixed by importing exception class HTTPError from module urllib2
Signed-off-by: Jiri Prochazka <jprochaz(a)redhat.com>
Signed-off-by: Jiri Pirko <jiri(a)resnulli.us>
lnst/Common/RecipePath.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/lnst/Common/RecipePath.py b/lnst/Common/RecipePath.py
index b976238..3199a1a 100644
--- a/lnst/Common/RecipePath.py
+++ b/lnst/Common/RecipePath.py
@@ -12,7 +12,7 @@ jtluka(a)redhat.com (Jan Tluka)
import os
from urlparse import urljoin
-from urllib2 import urlopen
+from urllib2 import urlopen, HTTPError
from tempfile import NamedTemporaryFile
def get_recipepath_class(root, path):
8 years, 7 months