summaryrefslogtreecommitdiff
path: root/examples/withallsubuids.py
diff options
context:
space:
mode:
authorHelmut Grohne <helmut@subdivi.de>2024-10-26 20:22:36 +0200
committerHelmut Grohne <helmut@subdivi.de>2024-10-26 20:22:36 +0200
commit64b2dab795e171e2ea0345732e96048cfb605466 (patch)
tree820dfeb1137afe09a445ad84867789c2015d7543 /examples/withallsubuids.py
parentf46f905dedd975a6d8c1e580adaa6ce79e2d55a1 (diff)
downloadpython-linuxnamespaces-64b2dab795e171e2ea0345732e96048cfb605466.tar.gz
add a method IDMapping.identity for convenience
Diffstat (limited to 'examples/withallsubuids.py')
-rwxr-xr-xexamples/withallsubuids.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/withallsubuids.py b/examples/withallsubuids.py
index 3bed3bc..2a0c9d5 100755
--- a/examples/withallsubuids.py
+++ b/examples/withallsubuids.py
@@ -19,7 +19,7 @@ import linuxnamespaces
def main() -> None:
# Construct an identity mapping of all available user/group ids
uidmap = [
- linuxnamespaces.IDMapping(os.getuid(), os.getuid(), 1),
+ linuxnamespaces.IDMapping.identity(os.getuid()),
*(
linuxnamespaces.IDMapping(start, start, count)
for start, count
@@ -27,7 +27,7 @@ def main() -> None:
),
]
gidmap = [
- linuxnamespaces.IDMapping(os.getgid(), os.getgid(), 1),
+ linuxnamespaces.IDMapping.identity(os.getgid()),
*(
linuxnamespaces.IDMapping(start, start, count)
for start, count