Re-add display of group members 29/16229/1
authorAndrew Grimberg <agrimberg@linuxfoundation.org>
Tue, 16 Jul 2019 20:59:46 +0000 (13:59 -0700)
committerAndrew Grimberg <agrimberg@linuxfoundation.org>
Tue, 16 Jul 2019 20:59:46 +0000 (13:59 -0700)
Change I76a5db63d584ab84a1ad12bfde1daffde0b619b0 removed the print out
of the members of groups from the search-members due to having moved to
the logging module and the output having been debug only output.

Since the point of search-members is to list out the members we need to
output the list.

Change-Id: Ib7ae9107a2db8da96067eb904982fafb8c7f10d7
Signed-off-by: Andrew Grimberg <agrimberg@linuxfoundation.org>
lftools/cli/lfidapi.py

index cfa8e44..f13eecd 100755 (executable)
@@ -10,6 +10,8 @@
 ##############################################################################
 """Use the LFIDAPI to add, remove and list members as well as create groups."""
 
+import logging
+
 import click
 
 from lftools.lfidapi import helper_create_group
@@ -18,6 +20,8 @@ from lftools.lfidapi import helper_match_ldap_to_info
 from lftools.lfidapi import helper_search_members
 from lftools.lfidapi import helper_user
 
+log = logging.getLogger(__name__)
+
 
 @click.group()
 @click.pass_context
@@ -31,7 +35,9 @@ def lfidapi(ctx):
 @click.pass_context
 def search_members(ctx, group):
     """List members of a group."""
-    helper_search_members(group)
+    members = helper_search_members(group)
+    for member in members:
+        log.info('%s <%s>' % (member['username'], member['mail']))
 
 
 @click.command()