diff options
author | Martin Babinsky <mbabinsk@redhat.com> | 2016-06-17 16:16:48 +0200 |
---|---|---|
committer | Martin Basti <mbasti@redhat.com> | 2016-06-17 19:00:14 +0200 |
commit | a540c909a7f63e7b0c19207eec69bd5914cb186e (patch) | |
tree | 3b1ca9fa4387b43888682bf9a14c3051a94d0a77 | |
parent | 31ffe1a12922b5118c847cbd6ac1ca9ea232ef94 (diff) | |
download | freeipa-a540c909a7f63e7b0c19207eec69bd5914cb186e.tar.gz freeipa-a540c909a7f63e7b0c19207eec69bd5914cb186e.tar.xz freeipa-a540c909a7f63e7b0c19207eec69bd5914cb186e.zip |
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>
-rw-r--r-- | ipaserver/plugins/server.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ipaserver/plugins/server.py b/ipaserver/plugins/server.py index b7d3ee826..42bcb393f 100644 --- a/ipaserver/plugins/server.py +++ b/ipaserver/plugins/server.py @@ -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( |