Fix listing of enabled roles in server-find

The roles can be thought of as membership attributes so we should only
list
them if `--all` is specified and `--no-members` is not.

Also do not show them if `--raw` is passed in.

https://fedorahosted.org/freeipa/ticket/5181

Reviewed-By: Martin Basti <mbasti@redhat.com>
This commit is contained in:
Martin Babinsky
2016-06-17 16:16:48 +02:00
committed by Martin Basti
parent 31ffe1a129
commit a540c909a7

View File

@@ -192,7 +192,10 @@ class server(LDAPObject):
entry_attrs['ipalocation_location'] = converted_locations
def get_enabled_roles(self, entry_attrs, **options):
if options.get('raw', False) or options.get('no_members', False):
if not options.get('all', False) and options.get('no_members', False):
return
if options.get('raw', False):
return
enabled_roles = self.api.Command.server_role_find(