]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
test-035: make it PEP8 compliant
authorKamalesh Babulal <kamalesh.babulal@oracle.com>
Tue, 15 Feb 2022 07:26:42 +0000 (12:56 +0530)
committerTom Hromatka <tom.hromatka@oracle.com>
Wed, 16 Feb 2022 19:09:18 +0000 (12:09 -0700)
Make test 035-cgset-set_cgroup_type.py PEP-8 compliant.

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

index 6e0c95383f6c9146a693cf4867077c0dd2fa8968..3570e1d589ee765f444b79ef62b6e39346ffd34e 100755 (executable)
 from cgroup import Cgroup, CgroupVersion
 import consts
 import ftests
-import os
 import sys
+import os
 
 # Which controller isn't all that important, but it is important that we
 # have a cgroup v2 controller
 CONTROLLER = 'cpu'
-CGNAME = "035cgset"
+CGNAME = '035cgset'
 
 SETTING = 'cgroup.type'
 BEFORE = 'domain'
 AFTER = 'threaded'
 
+
 def prereqs(config):
     result = consts.TEST_PASSED
     cause = None
 
     if config.args.container:
         result = consts.TEST_SKIPPED
-        cause = "This test cannot be run within a container"
+        cause = 'This test cannot be run within a container'
         return result, cause
 
     if CgroupVersion.get_version(CONTROLLER) != CgroupVersion.CGROUP_V2:
         result = consts.TEST_SKIPPED
-        cause = "This test requires cgroup v2"
+        cause = 'This test requires cgroup v2'
 
     return result, cause
 
+
 def setup(config):
     Cgroup.create(config, CONTROLLER, CGNAME)
     Cgroup.get_and_validate(config, CGNAME, SETTING, BEFORE)
 
     return consts.TEST_PASSED, None
 
+
 def test(config):
     Cgroup.set_and_validate(config, CGNAME, SETTING, AFTER)
 
     return consts.TEST_PASSED, None
 
+
 def teardown(config):
     Cgroup.delete(config, CONTROLLER, CGNAME)
 
+
 def main(config):
     [result, cause] = prereqs(config)
     if result != consts.TEST_PASSED:
@@ -78,6 +83,7 @@ def main(config):
 
     return [result, cause]
 
+
 if __name__ == '__main__':
     config = ftests.parse_args()
     # this test was invoked directly.  run only it