From 6bf67bb4c8707029309646e481125c25581e629b Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Thu, 19 Oct 2023 14:28:13 -0700 Subject: [PATCH] [stable-2.14] ansible-test - Fix parsing of cgroup entries (cherry picked from commit e933d9d8a6155478ce99518d111220e680201ca2) Co-authored-by: Matt Clay --- changelogs/fragments/ansible-test-cgroup-split.yml | 2 ++ test/lib/ansible_test/_internal/cgroup.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/ansible-test-cgroup-split.yml diff --git a/changelogs/fragments/ansible-test-cgroup-split.yml b/changelogs/fragments/ansible-test-cgroup-split.yml new file mode 100644 index 00000000000..c9dec0cf5cb --- /dev/null +++ b/changelogs/fragments/ansible-test-cgroup-split.yml @@ -0,0 +1,2 @@ +bugfixes: + - ansible-test - Fix parsing of cgroup entries which contain a ``:`` in the path (https://github.com/ansible/ansible/issues/81977). diff --git a/test/lib/ansible_test/_internal/cgroup.py b/test/lib/ansible_test/_internal/cgroup.py index a08513a55a1..c9da2465625 100644 --- a/test/lib/ansible_test/_internal/cgroup.py +++ b/test/lib/ansible_test/_internal/cgroup.py @@ -44,7 +44,7 @@ class CGroupEntry: @classmethod def parse(cls, value: str) -> CGroupEntry: """Parse the given cgroup line from the proc filesystem and return a cgroup entry.""" - cid, subsystem, path = value.split(':') + cid, subsystem, path = value.split(':', maxsplit=2) return cls( id=int(cid),