support/testing: rename variables for readability
authorLuca Ceresoli <luca@lucaceresoli.net>
Sat, 27 May 2017 21:58:46 +0000 (23:58 +0200)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Sun, 28 May 2017 12:54:43 +0000 (14:54 +0200)
The 'lines' variable is overwritten with its own fields. Thus it
contains a line first, and then a list of fields -- it never contains
'lines'.

Use two different variables named 'line' and 'fields' to make the code
more readable.

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Acked-by: Ricardo Martincoski <ricardo.martincoski@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
support/testing/tests/fs/test_ext.py

index 545bf1ed79acfe5b757ce903c4c993413ac3034e..ea3d3f11d7e7dff7b9d48a6b9f6cdc1bad8f91bd 100644 (file)
@@ -21,10 +21,10 @@ def dumpe2fs_run(builddir, image):
     return ret.strip().splitlines()
 
 def dumpe2fs_getprop(out, prop):
-    for lines in out:
-        lines = lines.split(": ")
-        if lines[0] == prop:
-            return lines[1].strip()
+    for line in out:
+        fields = line.split(": ")
+        if fields[0] == prop:
+            return fields[1].strip()
 
 def boot_img_and_check_fs_type(emulator, builddir, fs_type):
     img = os.path.join(builddir, "images", "rootfs.{}".format(fs_type))