]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
run.py: make it PEP8 compliant
authorKamalesh Babulal <kamalesh.babulal@oracle.com>
Thu, 17 Feb 2022 11:17:29 +0000 (16:47 +0530)
committerTom Hromatka <tom.hromatka@oracle.com>
Tue, 22 Feb 2022 19:52:52 +0000 (12:52 -0700)
Make run.py PEP-8 compliant.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
ftests/run.py

index 83fbc058e8c73fd14ce7529fd619ec31bddbeb13..ef837083f83079cb43691a2abeee1e7a8a068003 100644 (file)
@@ -21,7 +21,7 @@
 
 from log import Log
 import subprocess
-import time
+
 
 class Run(object):
     @staticmethod
@@ -46,18 +46,22 @@ class Run(object):
 
         if shell_bool:
             Log.log_debug(
-                "run:\n\tcommand = {}\n\tret = {}\n\tstdout = {}\n\tstderr = {}".format(
-                command, ret, out, err))
+                            'run:\n\tcommand = {}\n\tret = {}\n\tstdout = {}'
+                            '\n\tstderr = {}'
+                            ''.format(command, ret, out, err)
+                         )
         else:
             Log.log_debug(
-                "run:\n\tcommand = {}\n\tret = {}\n\tstdout = {}\n\tstderr = {}".format(
-                ' '.join(command), ret, out, err))
+                            'run:\n\tcommand = {}\n\tret = {}\n\tstdout = {}'
+                            '\n\tstderr = {}'
+                            ''.format(' '.join(command), ret, out, err)
+                         )
 
         if ret != 0:
             raise RunError("Command '{}' failed".format(''.join(command)),
                            command, ret, out, err)
         if ret != 0 or len(err) > 0:
-            if err.find("WARNING: cgroup v2 is not fully supported yet") == -1:
+            if err.find('WARNING: cgroup v2 is not fully supported yet') == -1:
                 # LXD throws the above warning on systems that are fully
                 # running cgroup v2.  Ignore this warning, but fail if any
                 # other warnings/errors are raised
@@ -66,6 +70,7 @@ class Run(object):
 
         return out
 
+
 class RunError(Exception):
     def __init__(self, message, command, ret, stdout, stderr):
         super(RunError, self).__init__(message)
@@ -76,9 +81,10 @@ class RunError(Exception):
         self.stderr = stderr
 
     def __str__(self):
-        out_str = "RunError:\n\tcommand = {}\n\tret = {}".format(
+        out_str = 'RunError:\n\tcommand = {}\n\tret = {}'.format(
                   self.command, self.ret)
-        out_str += "\n\tstdout = {}\n\tstderr = {}".format(self.stdout, self.stderr)
+        out_str += '\n\tstdout = {}\n\tstderr = {}'.format(self.stdout,
+                                                           self.stderr)
         return out_str
 
 # vim: set et ts=4 sw=4: