Signed-off-by: Lucas Meneghel Rodrigues <[email protected]>
---
client/virt/utils_test.py | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/client/virt/utils_test.py b/client/virt/utils_test.py
index c43b594..8def3ea 100644
--- a/client/virt/utils_test.py
+++ b/client/virt/utils_test.py
@@ -63,7 +63,7 @@ def wait_for_login(vm, nic_index=0, timeout=240, start=0,
step=2, serial=None):
end_time = time.time() + timeout
session = None
if serial:
- type = 'serial'
+ mode = 'serial'
logging.info("Trying to log into guest %s using serial connection,"
" timeout %ds", vm.name, timeout)
time.sleep(start)
@@ -75,7 +75,7 @@ def wait_for_login(vm, nic_index=0, timeout=240, start=0,
step=2, serial=None):
logging.debug(e)
time.sleep(step)
else:
- type = 'remote'
+ mode = 'remote'
logging.info("Trying to log into guest %s using remote connection,"
" timeout %ds", vm.name, timeout)
time.sleep(start)
@@ -88,8 +88,8 @@ def wait_for_login(vm, nic_index=0, timeout=240, start=0,
step=2, serial=None):
time.sleep(step)
if not session:
raise error.TestFail("Could not log into guest %s using %s connection"
%
- (vm.name, type))
- logging.info("Logged into guest %s using %s connection", vm.name, type)
+ (vm.name, mode))
+ logging.info("Logged into guest %s using %s connection", vm.name, mode)
return session
@@ -1466,14 +1466,14 @@ def pin_vm_threads(vm, node):
logging.info("pin vcpu thread(%s) to cpu(%s)" % (i, node.pin_cpu(i)))
-def service_setup(vm, session, dir):
+def service_setup(vm, session, directory):
params = vm.get_params()
rh_perf_envsetup_script = params.get("rh_perf_envsetup_script")
rebooted = params.get("rebooted", "rebooted")
if rh_perf_envsetup_script:
- src = os.path.join(dir, rh_perf_envsetup_script)
+ src = os.path.join(directory, rh_perf_envsetup_script)
vm.copy_files_to(src, "/tmp/rh_perf_envsetup.sh")
logging.info("setup perf environment for host")
commands.getoutput("bash %s host %s" % (src, rebooted))
@@ -1493,7 +1493,7 @@ def cmd_runner_monitor(vm, monitor_cmd, test_cmd,
guest_path, timeout=300):
"""
def thread_kill(cmd, p_file):
fd = shelve.open(p_file)
- s, o = commands.getstatusoutput("pstree -p %s" % fd["pid"])
+ o = commands.getoutput("pstree -p %s" % fd["pid"])
tmp = re.split("\s+", cmd)[0]
pid = re.findall("%s.(\d+)" % tmp, o)[0]
s, o = commands.getstatusoutput("kill -9 %s" % pid)
@@ -1540,7 +1540,7 @@ def cmd_runner_monitor(vm, monitor_cmd, test_cmd,
guest_path, timeout=300):
vm.copy_files_from("%s_monitor" % guest_path, guest_monitor_result_file)
return tag
-def aton(str):
+def aton(sr):
"""
Transform a string to a number(include float and int). If the string is
not in the form of number, just return false.
@@ -1549,10 +1549,10 @@ def aton(str):
Return: float, int or False for failed transform
"""
try:
- return int(str)
+ return int(sr)
except ValueError:
try:
- return float(str)
+ return float(sr)
except ValueError:
return False
@@ -1578,7 +1578,7 @@ def summary_up_result(result_file, ignore, row_head,
column_mark):
if len(re.findall(ignore, eachLine)) == 0:
if len(re.findall(column_mark, eachLine)) != 0 and not head_flag:
column = 0
- empty, row, eachLine = re.split(row_head, eachLine)
+ _, row, eachLine = re.split(row_head, eachLine)
for i in re.split("\s+", eachLine):
if i:
result_dict[i] = {}
@@ -1587,7 +1587,7 @@ def summary_up_result(result_file, ignore, row_head,
column_mark):
head_flag = True
elif len(re.findall(column_mark, eachLine)) == 0:
column = 0
- empty, row, eachLine = re.split(row_head, eachLine)
+ _, row, eachLine = re.split(row_head, eachLine)
row_flag = False
for i in row_list:
if row == i:
--
1.7.11.4
_______________________________________________
Autotest-kernel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/autotest-kernel