diff options
author | Tomas Babej <tbabej@redhat.com> | 2014-07-31 14:18:31 +0200 |
---|---|---|
committer | Tomas Babej <tbabej@redhat.com> | 2014-09-17 14:41:50 +0200 |
commit | 378b766bd2c0152b4de476c69a5cb4020b1ddc1c (patch) | |
tree | 17543869f68e112548497db9a3b151904842a56d | |
parent | 9793e44380f8fcdefa1a33fad5fad30ac9a9ac3f (diff) | |
download | freeipa-378b766bd2c0152b4de476c69a5cb4020b1ddc1c.tar.gz freeipa-378b766bd2c0152b4de476c69a5cb4020b1ddc1c.tar.xz freeipa-378b766bd2c0152b4de476c69a5cb4020b1ddc1c.zip |
hostgroup: Add helper that returns all members of a hostgroup
Part of: https://fedorahosted.org/freeipa/ticket/3979
-rw-r--r-- | ipalib/plugins/hostgroup.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ipalib/plugins/hostgroup.py b/ipalib/plugins/hostgroup.py index 0e86e9920..04891cc96 100644 --- a/ipalib/plugins/hostgroup.py +++ b/ipalib/plugins/hostgroup.py @@ -54,6 +54,14 @@ EXAMPLES: ipa hostgroup-del baltimore """) + +def get_complete_hostgroup_member_list(hostgroup): + result = api.Command['hostgroup_show'](hostgroup)['result'] + direct = list(result.get('member_host', [])) + indirect = list(result.get('memberindirect_host', [])) + return direct + indirect + + register = Registry() @register() |