summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorHelmut Grohne <helmut@subdivi.de>2024-02-15 22:31:51 +0100
committerHelmut Grohne <helmut@subdivi.de>2024-02-15 22:50:26 +0100
commitd8ecc510108426fba8f9a53e0d5fa54d5942e75f (patch)
treed37c1fe311be473745df1717bc213afb976133eb /examples
parent72ff759384538d412b5114d72b3115b730c06406 (diff)
downloadpython-linuxnamespaces-d8ecc510108426fba8f9a53e0d5fa54d5942e75f.tar.gz
MountFlags: support conversion to and from a textual representation
The textual representation matches util-linux. Not all flag values can be represented textually.
Diffstat (limited to 'examples')
-rwxr-xr-xexamples/cgroup.py6
1 files changed, 1 insertions, 5 deletions
diff --git a/examples/cgroup.py b/examples/cgroup.py
index 06eb3b3..0c52efb 100755
--- a/examples/cgroup.py
+++ b/examples/cgroup.py
@@ -123,11 +123,7 @@ def main() -> None:
"tmpfs",
"/sys",
"tmpfs",
- linuxnamespaces.MountFlags.REMOUNT
- | linuxnamespaces.MountFlags.RDONLY
- | linuxnamespaces.MountFlags.NOEXEC
- | linuxnamespaces.MountFlags.NOSUID
- | linuxnamespaces.MountFlags.NODEV,
+ linuxnamespaces.MountFlags.fromstr("remount,ro,noexec,nosuid,nodev"),
"mode=0755",
)
linuxnamespaces.move_mount(cgroupfd, "/sys/fs/cgroup")