tests/acceptance/virtiofs_submounts.py: evaluate string not length
authorCleber Rosa <crosa@redhat.com>
Mon, 12 Apr 2021 04:46:35 +0000 (00:46 -0400)
committerJohn Snow <jsnow@redhat.com>
Tue, 1 Jun 2021 20:21:20 +0000 (16:21 -0400)
If the vmlinuz variable is set to anything that evaluates to True,
then the respective arguments should be set.  If the variable contains
an empty string, than it will evaluate to False, and the extra
arguments will not be set.

This keeps the same logic, but improves readability a bit.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
Reviewed-by: Beraldo Leal <bleal@redhat.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Willian Rampazzo <willianr@redhat.com>
Message-Id: <20210412044644.55083-3-crosa@redhat.com>
Signed-off-by: John Snow <jsnow@redhat.com>
tests/acceptance/virtiofs_submounts.py

index 5b74ce2929bd7c750162fb619fc50182608efed5..ca64b76301f3af7905357f1f520bd4a02c0398e3 100644 (file)
@@ -251,7 +251,7 @@ class VirtiofsSubmountsTest(LinuxTest):
 
         super(VirtiofsSubmountsTest, self).setUp(pubkey)
 
-        if len(vmlinuz) > 0:
+        if vmlinuz:
             self.vm.add_args('-kernel', vmlinuz,
                              '-append', 'console=ttyS0 root=/dev/sda1')