[PATCH 01/10] Fix "Undefined variable 'config'" error
by Jiri Prochazka
Found with pylint. Try-except would always fail, due to variable config being undefined.
This patch assigns variable self._dev_config to config which should resolve the bug
Signed-off-by: Jiri Prochazka <jprochaz(a)redhat.com>
---
lnst/Slave/NmConfigDevice.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/lnst/Slave/NmConfigDevice.py b/lnst/Slave/NmConfigDevice.py
index 60d5d0a..c3824cb 100644
--- a/lnst/Slave/NmConfigDevice.py
+++ b/lnst/Slave/NmConfigDevice.py
@@ -460,6 +460,7 @@ class NmConfigDeviceBond(NmConfigDeviceGeneric):
self._nm_add_connection()
def _rm_bond(self):
+ config = self._dev_config
if self._con_obj_path != None:
self._nm_rm_connection()
@@ -550,6 +551,7 @@ class NmConfigDeviceBridge(NmConfigDeviceGeneric):
self._nm_add_connection()
def _rm_bridge(self):
+ config = self._dev_config
if self._con_obj_path != None:
self._nm_rm_connection()
--
2.1.0
9 years
[lnst] Fix "Module 'os' has no 'exit' member" error
by Jiří Pírko
commit acaffe552d5a8c296ebe50a32e884b74a7ca9b4f
Author: Jiri Prochazka <jprochaz(a)redhat.com>
Date: Tue Apr 21 15:10:44 2015 +0200
Fix "Module 'os' has no 'exit' member" error
Found with pylint. Fix typo when module os is used instead of sys for calling exit method
Signed-off-by: Jiri Prochazka <jprochaz(a)redhat.com>
Signed-off-by: Jiri Pirko <jiri(a)resnulli.us>
lnst/Common/Daemon.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/lnst/Common/Daemon.py b/lnst/Common/Daemon.py
index 9dd2847..6fbf950 100644
--- a/lnst/Common/Daemon.py
+++ b/lnst/Common/Daemon.py
@@ -57,7 +57,7 @@ class Daemon:
if pid:
if self._check_pid(pid):
logging.error("pidfile in use")
- os.exit(1)
+ sys.exit(1)
else:
self._del_pidfile()
try:
9 years
[lnst] Fix "Undefined variable 'directory'" error
by Jiří Pírko
commit 918daf7e7007633927783672d56742fdddc493af
Author: Jiri Prochazka <jprochaz(a)redhat.com>
Date: Tue Apr 21 15:10:43 2015 +0200
Fix "Undefined variable 'directory'" error
Found with pylint. Changed variable directory to filepath, as it should be.
Signed-off-by: Jiri Prochazka <jprochaz(a)redhat.com>
Signed-off-by: Jiri Pirko <jiri(a)resnulli.us>
lnst/Common/Utils.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/lnst/Common/Utils.py b/lnst/Common/Utils.py
index 210dbeb..38aa48b 100644
--- a/lnst/Common/Utils.py
+++ b/lnst/Common/Utils.py
@@ -139,7 +139,7 @@ def has_changed_since(filepath, threshold):
if os.path.isfile(filepath):
return _is_newer_than(filepath, threshold)
- for root, dirs, files in os.walk(directory):
+ for root, dirs, files in os.walk(filepath):
for f in files:
if _is_newer_than(f, threshold):
return False
9 years
[lnst] Fix "Using variable 'input_file' before assignment" error
by Jiří Pírko
commit f2a75fe6c38ad94d48975beae59d8c520b1b7b1a
Author: Jiri Prochazka <jprochaz(a)redhat.com>
Date: Tue Apr 21 15:10:42 2015 +0200
Fix "Using variable 'input_file' before assignment" error
Found with pylint. Construction which used variable input_file was moved after the input_file was assigned.
Signed-off-by: Jiri Prochazka <jprochaz(a)redhat.com>
Signed-off-by: Jiri Pirko <jiri(a)resnulli.us>
lnst/Common/Utils.py | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/lnst/Common/Utils.py b/lnst/Common/Utils.py
index fb9d9a2..210dbeb 100644
--- a/lnst/Common/Utils.py
+++ b/lnst/Common/Utils.py
@@ -112,13 +112,13 @@ def create_tar_archive(input_path, target_path, compression=False):
else:
args = "cf"
- if os.path.isdir(target_path):
- target_path += "/%s.tar.bz" % os.path.basename(input_file.rstrip("/"))
-
input_path = input_path.rstrip("/")
input_file = os.path.basename(input_path)
parent = os.path.dirname(input_path)
+ if os.path.isdir(target_path):
+ target_path += "/%s.tar.bz" % os.path.basename(input_file.rstrip("/"))
+
exec_cmd("cd \"%s\" && tar %s \"%s\" \"%s\"" % \
(parent, args, target_path, input_file))
9 years
[lnst] Fix "Undefined variable 'config'" error
by Jiří Pírko
commit 0dd80307aafb3de3a2c5924c35ea42c8776e0bf5
Author: Jiri Prochazka <jprochaz(a)redhat.com>
Date: Tue Apr 21 15:10:41 2015 +0200
Fix "Undefined variable 'config'" error
Found with pylint. Try-except would always fail, due to variable config being undefined.
This patch assigns variable self._dev_config to config which should resolve the bug
Signed-off-by: Jiri Prochazka <jprochaz(a)redhat.com>
Signed-off-by: Jiri Pirko <jiri(a)resnulli.us>
lnst/Slave/NmConfigDevice.py | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/lnst/Slave/NmConfigDevice.py b/lnst/Slave/NmConfigDevice.py
index 60d5d0a..c3824cb 100644
--- a/lnst/Slave/NmConfigDevice.py
+++ b/lnst/Slave/NmConfigDevice.py
@@ -460,6 +460,7 @@ class NmConfigDeviceBond(NmConfigDeviceGeneric):
self._nm_add_connection()
def _rm_bond(self):
+ config = self._dev_config
if self._con_obj_path != None:
self._nm_rm_connection()
@@ -550,6 +551,7 @@ class NmConfigDeviceBridge(NmConfigDeviceGeneric):
self._nm_add_connection()
def _rm_bridge(self):
+ config = self._dev_config
if self._con_obj_path != None:
self._nm_rm_connection()
9 years
[lnst] recipes: fix undefined host variables in phase1 virtual test
by Jiří Pírko
commit 41f6621ab7f54124e88f5f6fb6bebe20d2a2a834
Author: Jan Tluka <jtluka(a)redhat.com>
Date: Tue Apr 21 13:46:15 2015 +0200
recipes: fix undefined host variables in phase1 virtual test
This patch fixes another undefined reference. The issue was found in
virtual_bridge_2_vlans_over_bond.py in phase1 test set.
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
Signed-off-by: Jiri Pirko <jiri(a)resnulli.us>
.../phase1/virtual_bridge_2_vlans_over_bond.py | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/recipes/regression_tests/phase1/virtual_bridge_2_vlans_over_bond.py b/recipes/regression_tests/phase1/virtual_bridge_2_vlans_over_bond.py
index c3c43b8..57d24cf 100644
--- a/recipes/regression_tests/phase1/virtual_bridge_2_vlans_over_bond.py
+++ b/recipes/regression_tests/phase1/virtual_bridge_2_vlans_over_bond.py
@@ -5,14 +5,14 @@ from lnst.Controller.Task import ctl
# ------
# Host 1 + guests 1 and 2
-#h1 = ctl.get_host("host1")
+h1 = ctl.get_host("host1")
g1 = ctl.get_host("guest1")
g1.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
g2 = ctl.get_host("guest2")
g2.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
# Host 2 + guests 3 and 4
-#h2 = ctl.get_host("host2")
+h2 = ctl.get_host("host2")
g3 = ctl.get_host("guest3")
g3.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
g4 = ctl.get_host("guest4")
9 years
[lnst] recipes: fix undefined host variables error in ovs test
by Jiří Pírko
commit b3bd0525f39885ac29d2e66492984b7d342593ab
Author: Jan Tluka <jtluka(a)redhat.com>
Date: Tue Apr 21 11:03:59 2015 +0200
recipes: fix undefined host variables error in ovs test
The patch fixes undefined variable error. The variables were commented
out and later referenced.
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
Signed-off-by: Jiri Pirko <jiri(a)resnulli.us>
...l_ovs_bridge_2_vlans_over_active_backup_bond.py | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/recipes/regression_tests/phase2/virtual_ovs_bridge_2_vlans_over_active_backup_bond.py b/recipes/regression_tests/phase2/virtual_ovs_bridge_2_vlans_over_active_backup_bond.py
index 92e5253..7238e1b 100644
--- a/recipes/regression_tests/phase2/virtual_ovs_bridge_2_vlans_over_active_backup_bond.py
+++ b/recipes/regression_tests/phase2/virtual_ovs_bridge_2_vlans_over_active_backup_bond.py
@@ -5,14 +5,14 @@ from lnst.Controller.Task import ctl
# ------
# Host 1 + guests 1 and 2
-#h1 = ctl.get_host("host1")
+h1 = ctl.get_host("host1")
g1 = ctl.get_host("guest1")
g1.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
g2 = ctl.get_host("guest2")
g2.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
# Host 2 + guests 3 and 4
-#h2 = ctl.get_host("host2")
+h2 = ctl.get_host("host2")
g3 = ctl.get_host("guest3")
g3.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
g4 = ctl.get_host("guest4")
9 years
[PATCH] recipes: fix undefined host variables in phase1 virtual test
by Jan Tluka
This patch fixes another undefined reference. The issue was found in
virtual_bridge_2_vlans_over_bond.py in phase1 test set.
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
---
recipes/regression_tests/phase1/virtual_bridge_2_vlans_over_bond.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/recipes/regression_tests/phase1/virtual_bridge_2_vlans_over_bond.py b/recipes/regression_tests/phase1/virtual_bridge_2_vlans_over_bond.py
index c3c43b8..57d24cf 100644
--- a/recipes/regression_tests/phase1/virtual_bridge_2_vlans_over_bond.py
+++ b/recipes/regression_tests/phase1/virtual_bridge_2_vlans_over_bond.py
@@ -5,14 +5,14 @@ from lnst.Controller.Task import ctl
# ------
# Host 1 + guests 1 and 2
-#h1 = ctl.get_host("host1")
+h1 = ctl.get_host("host1")
g1 = ctl.get_host("guest1")
g1.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
g2 = ctl.get_host("guest2")
g2.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
# Host 2 + guests 3 and 4
-#h2 = ctl.get_host("host2")
+h2 = ctl.get_host("host2")
g3 = ctl.get_host("guest3")
g3.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
g4 = ctl.get_host("guest4")
--
1.9.3
9 years
[PATCH] recipes: fix undefined host variables error in ovs test
by Jan Tluka
The patch fixes undefined variable error. The variables were commented
out and later referenced.
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
---
.../phase2/virtual_ovs_bridge_2_vlans_over_active_backup_bond.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/recipes/regression_tests/phase2/virtual_ovs_bridge_2_vlans_over_active_backup_bond.py b/recipes/regression_tests/phase2/virtual_ovs_bridge_2_vlans_over_active_backup_bond.py
index 92e5253..7238e1b 100644
--- a/recipes/regression_tests/phase2/virtual_ovs_bridge_2_vlans_over_active_backup_bond.py
+++ b/recipes/regression_tests/phase2/virtual_ovs_bridge_2_vlans_over_active_backup_bond.py
@@ -5,14 +5,14 @@ from lnst.Controller.Task import ctl
# ------
# Host 1 + guests 1 and 2
-#h1 = ctl.get_host("host1")
+h1 = ctl.get_host("host1")
g1 = ctl.get_host("guest1")
g1.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
g2 = ctl.get_host("guest2")
g2.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
# Host 2 + guests 3 and 4
-#h2 = ctl.get_host("host2")
+h2 = ctl.get_host("host2")
g3 = ctl.get_host("guest3")
g3.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
g4 = ctl.get_host("guest4")
--
1.9.3
9 years
[PATCH] Revert "recipes: use proper virtio_net driver name in virtual setups"
by Jan Tluka
This reverts commit 6062bbad7862eccce94a66afbc4b3bb0d487dbfa.
Let's stay with original 'virtio' value so that we won't have to add
workaround in LNST.
---
recipes/regression_tests/phase1/virtual_bridge_vlan_in_guest.xml | 6 +-----
recipes/regression_tests/phase1/virtual_bridge_vlan_in_host.xml | 3 ---
.../regression_tests/phase2/virtual_ovs_bridge_vlan_in_guest.xml | 6 +-----
recipes/regression_tests/phase2/virtual_ovs_bridge_vlan_in_host.xml | 2 +-
4 files changed, 3 insertions(+), 14 deletions(-)
diff --git a/recipes/regression_tests/phase1/virtual_bridge_vlan_in_guest.xml b/recipes/regression_tests/phase1/virtual_bridge_vlan_in_guest.xml
index 0d448a8..fb5bf61 100644
--- a/recipes/regression_tests/phase1/virtual_bridge_vlan_in_guest.xml
+++ b/recipes/regression_tests/phase1/virtual_bridge_vlan_in_guest.xml
@@ -20,11 +20,7 @@
</host>
<host id="guest1">
<interfaces>
- <eth id="guestnic" label="to_guest">
- <params>
- <param name="driver" value="virtio_net"/>
- </params>
- </eth>
+ <eth id="guestnic" label="to_guest" />
<vlan id="vlan10">
<options>
<option name="vlan_tci" value="10" />
diff --git a/recipes/regression_tests/phase1/virtual_bridge_vlan_in_host.xml b/recipes/regression_tests/phase1/virtual_bridge_vlan_in_host.xml
index 26a16c3..8636ce0 100644
--- a/recipes/regression_tests/phase1/virtual_bridge_vlan_in_host.xml
+++ b/recipes/regression_tests/phase1/virtual_bridge_vlan_in_host.xml
@@ -29,9 +29,6 @@
<host id="guest1">
<interfaces>
<eth id="guestnic" label="to_guest">
- <params>
- <param name="driver" value="virtio_net"/>
- </params>
<addresses>
<address>192.168.10.10/24</address>
<address>2002::10:10/64</address>
diff --git a/recipes/regression_tests/phase2/virtual_ovs_bridge_vlan_in_guest.xml b/recipes/regression_tests/phase2/virtual_ovs_bridge_vlan_in_guest.xml
index 0cfd079..c262cab 100644
--- a/recipes/regression_tests/phase2/virtual_ovs_bridge_vlan_in_guest.xml
+++ b/recipes/regression_tests/phase2/virtual_ovs_bridge_vlan_in_guest.xml
@@ -17,11 +17,7 @@
</host>
<host id="guest1">
<interfaces>
- <eth id="guestnic" label="to_guest">
- <params>
- <param name="driver" value="virtio_net"/>
- </params>
- </eth>
+ <eth id="guestnic" label="to_guest" />
<vlan id="vlan10">
<options>
<option name="vlan_tci" value="10" />
diff --git a/recipes/regression_tests/phase2/virtual_ovs_bridge_vlan_in_host.xml b/recipes/regression_tests/phase2/virtual_ovs_bridge_vlan_in_host.xml
index 6b2c978..d425b82 100644
--- a/recipes/regression_tests/phase2/virtual_ovs_bridge_vlan_in_host.xml
+++ b/recipes/regression_tests/phase2/virtual_ovs_bridge_vlan_in_host.xml
@@ -24,7 +24,7 @@
<interfaces>
<eth id="guestnic" label="to_guest">
<params>
- <param name="driver" value="virtio_net"/>
+ <param name="driver" value="virtio"/>
</params>
<addresses>
<address>192.168.10.10/24</address>
--
1.9.3
9 years