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

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

index d237d858cff163e55a00b7f312b11ccb7f2dd7eb..396f72d614c762ec5d355685d419cd51ddfba8ec 100644 (file)
 # along with this library; if not, see <http://www.gnu.org/licenses>.
 #
 
-import grp
-import os
 from run import Run
+import os
+
 
 # function to indent a block of text by cnt number of spaces
 def indent(in_str, cnt):
     leading_indent = cnt * ' '
     return ''.join(leading_indent + line for line in in_str.splitlines(True))
 
+
 def get_file_owner_uid(config, filename):
     cmd = list()
     cmd.append('stat')
     cmd.append('-c')
-    cmd.append('\'%u\'')
+    cmd.append("'%u'")
     cmd.append(filename)
 
     if config.args.container:
@@ -40,11 +41,12 @@ def get_file_owner_uid(config, filename):
     else:
         return Run.run(cmd, shell_bool=True)
 
+
 def get_file_owner_username(config, filename):
     cmd = list()
     cmd.append('stat')
     cmd.append('-c')
-    cmd.append('\'%U\'')
+    cmd.append("'%U'")
     cmd.append(filename)
 
     if config.args.container:
@@ -53,11 +55,12 @@ def get_file_owner_username(config, filename):
         return Run.run(cmd, shell_bool=True)
     return os.stat(filename).st_uid
 
+
 def get_file_owner_gid(config, filename):
     cmd = list()
     cmd.append('stat')
     cmd.append('-c')
-    cmd.append('\'%g\'')
+    cmd.append("'%g'")
     cmd.append(filename)
 
     if config.args.container:
@@ -65,11 +68,12 @@ def get_file_owner_gid(config, filename):
     else:
         return Run.run(cmd, shell_bool=True)
 
+
 def get_file_owner_group_name(config, filename):
     cmd = list()
     cmd.append('stat')
     cmd.append('-c')
-    cmd.append('\'%G\'')
+    cmd.append("'%G'")
     cmd.append(filename)
 
     if config.args.container:
@@ -77,11 +81,12 @@ def get_file_owner_group_name(config, filename):
     else:
         return Run.run(cmd, shell_bool=True)
 
+
 def get_file_permissions(config, filename):
     cmd = list()
     cmd.append('stat')
     cmd.append('-c')
-    cmd.append('\'%a\'')
+    cmd.append("'%a'")
     cmd.append(filename)
 
     if config.args.container: