From: Tom Hromatka Date: Tue, 18 Jul 2023 13:59:56 +0000 (-0600) Subject: python: Rename __set_default_systemd_cgroup() X-Git-Tag: v3.1.0~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=61e7f989f6d375ca8d6702f5ce1edad0f83398c1;p=thirdparty%2Flibcgroup.git python: Rename __set_default_systemd_cgroup() Rename __set_default_systemd_cgroup() to _set_default_systemd_cgroup() to avoid Python name mangling Signed-off-by: Tom Hromatka Reviewed-by: Kamalesh Babulal --- diff --git a/src/python/libcgroup.pyx b/src/python/libcgroup.pyx index 090118ec..407963ab 100644 --- a/src/python/libcgroup.pyx +++ b/src/python/libcgroup.pyx @@ -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 diff --git a/tests/ftests/071-sudo-set_default_systemd_cgroup.py b/tests/ftests/071-sudo-set_default_systemd_cgroup.py index 231199be..2c453203 100755 --- a/tests/ftests/071-sudo-set_default_systemd_cgroup.py +++ b/tests/ftests/071-sudo-set_default_systemd_cgroup.py @@ -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