From 3e9bb606b4050fe9feb359e4cc038a0ac4e671e3 Mon Sep 17 00:00:00 2001 From: Rob Crittenden Date: Thu, 22 Jul 2021 15:53:00 -0400 Subject: [PATCH] Display all orphaned keys in automountlocation-tofiles Only the first key was being displayed for any orphaned map. https://pagure.io/freeipa/issue/7814 Signed-off-by: Rob Crittenden Reviewed-By: Francois Cami --- ipaclient/plugins/automount.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/ipaclient/plugins/automount.py b/ipaclient/plugins/automount.py index 650c74854..b4be17e64 100644 --- a/ipaclient/plugins/automount.py +++ b/ipaclient/plugins/automount.py @@ -104,13 +104,15 @@ class automountlocation_tofiles(MethodOverride): textui.print_plain('/etc/%s:' % m['automountmapname']) for k in orphankeys: if len(k) == 0: continue - dn = DN(k[0]['dn']) - if dn['automountmapname'] == m['automountmapname'][0]: - textui.print_plain( - '%s\t%s' % ( - k[0]['automountkey'][0], k[0]['automountinformation'][0] + for key in k: + dn = DN(key['dn']) + if dn['automountmapname'] == m['automountmapname'][0]: + textui.print_plain( + '%s\t%s' % ( + key['automountkey'][0], + key['automountinformation'][0] + ) ) - ) @register()