]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
python: Rename __set_default_systemd_cgroup()
authorTom Hromatka <tom.hromatka@oracle.com>
Tue, 18 Jul 2023 13:59:56 +0000 (07:59 -0600)
committerTom Hromatka <tom.hromatka@oracle.com>
Wed, 19 Jul 2023 02:59:56 +0000 (20:59 -0600)
Rename __set_default_systemd_cgroup() to _set_default_systemd_cgroup()
to avoid Python name mangling

Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
Reviewed-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
src/python/libcgroup.pyx
tests/ftests/071-sudo-set_default_systemd_cgroup.py

index 090118ec384fab1b47c890ac6bc4631dd9a7108f..407963ab86ded9dec2648c330d9e7c12c62d0bb7 100644 (file)
@@ -570,7 +570,7 @@ cdef class Cgroup:
             raise RuntimeError("cgroup_create_scope2 failed: {}".format(ret))
 
     @staticmethod
-    def __set_default_systemd_cgroup():
+    def _set_default_systemd_cgroup():
         """Set systemd_default_cgroup
 
         Arguments:
@@ -619,7 +619,7 @@ cdef class Cgroup:
             raise RuntimeError("Failed to write the default slice/scope")
 
         if set_default:
-            Cgroup.__set_default_systemd_cgroup()
+            Cgroup._set_default_systemd_cgroup()
 
     @staticmethod
     def clear_default_systemd_scope():
@@ -636,7 +636,7 @@ cdef class Cgroup:
             pass
 
         try:
-            Cgroup.__set_default_systemd_cgroup()
+            Cgroup._set_default_systemd_cgroup()
         except RuntimeError:
             pass
 
index 231199beb74487641c11aad0b7d8a34730b62223..2c45320375b5d4c85ccdb760f55ee650ab2877c1 100755 (executable)
@@ -45,11 +45,11 @@ def test(config):
     cause = None
 
     #
-    # Test 1 - Ensure __set_default_systemd_cgroup() throws an exception if
+    # Test 1 - Ensure _set_default_systemd_cgroup() throws an exception if
     #          libcgroup doesn't set a default (slice/scope) cgroup path
     #
     try:
-        Cgroup.__set_default_systemd_cgroup()
+        Cgroup._set_default_systemd_cgroup()
     except RuntimeError as re:
         if 'Failed to set' not in str(re):
             result = consts.TEST_FAILED
@@ -57,7 +57,7 @@ def test(config):
                     'received {}'.format(str(re))
     else:
         result = consts.TEST_FAILED
-        cause = '__set_default_systemd_cgroup() erroneously passed'
+        cause = '_set_default_systemd_cgroup() erroneously passed'
 
     #
     # Test 2 - write_default_systemd_scope() should succeed if the slice/scope