diff --git a/changelogs/fragments/5943-zfs_delegate_admin-fix-zfs-allow-cannot-parse-unknown-uid-gid.yml b/changelogs/fragments/5943-zfs_delegate_admin-fix-zfs-allow-cannot-parse-unknown-uid-gid.yml new file mode 100644 index 00000000000..f07ca8a9a58 --- /dev/null +++ b/changelogs/fragments/5943-zfs_delegate_admin-fix-zfs-allow-cannot-parse-unknown-uid-gid.yml @@ -0,0 +1,2 @@ +bugfixes: + - zfs_delegate_admin - zfs allow output can now be parsed when uids/gids are not known to the host system (https://github.com/ansible-collections/community.general/pull/5943). diff --git a/plugins/modules/zfs_delegate_admin.py b/plugins/modules/zfs_delegate_admin.py index 36a213a0fef..d7ebd8022f1 100644 --- a/plugins/modules/zfs_delegate_admin.py +++ b/plugins/modules/zfs_delegate_admin.py @@ -177,6 +177,9 @@ def current_perms(self): scope = linemap.get(line, scope) if not scope: continue + if ' (unknown: ' in line: + line = line.replace('(unknown: ', '', 1) + line = line.replace(')', '', 1) try: if line.startswith('\tuser ') or line.startswith('\tgroup '): ent_type, ent, cur_perms = line.split()