diff options
author | Rob Crittenden <rcritten@redhat.com> | 2011-08-30 14:08:34 -0400 |
---|---|---|
committer | Rob Crittenden <rcritten@redhat.com> | 2011-08-29 21:29:16 -0400 |
commit | e52f6528736f311e06c188e5b4858b6fc0ec16f0 (patch) | |
tree | deb2e81dca6e0ec23b47fce3afa1d0027881872c | |
parent | 327d67fe8db30655315a8616f0c1c5da491910e0 (diff) | |
download | freeipa-e52f6528736f311e06c188e5b4858b6fc0ec16f0.tar.gz freeipa-e52f6528736f311e06c188e5b4858b6fc0ec16f0.tar.xz freeipa-e52f6528736f311e06c188e5b4858b6fc0ec16f0.zip |
Add netgroup as possible memberOf for hostgroups
https://fedorahosted.org/freeipa/ticket/1563
-rw-r--r-- | API.txt | 4 | ||||
-rw-r--r-- | ipalib/plugins/hostgroup.py | 2 | ||||
-rw-r--r-- | tests/test_xmlrpc/test_hostgroup_plugin.py | 7 | ||||
-rw-r--r-- | tests/test_xmlrpc/test_nesting.py | 5 | ||||
-rw-r--r-- | tests/test_xmlrpc/test_netgroup_plugin.py | 1 |
5 files changed, 17 insertions, 2 deletions
@@ -1486,7 +1486,7 @@ output: Output('summary', (<type 'unicode'>, <type 'NoneType'>), 'User-friendly output: Output('result', <type 'dict'>, 'list of deletions that failed') output: Output('value', <type 'unicode'>, "The primary_key value of the entry, e.g. 'jdoe' for a user") command: hostgroup_find -args: 1,17,4 +args: 1,19,4 arg: Str('criteria?', noextrawhitespace=False) option: Str('cn', attribute=True, autofill=False, cli_name='hostgroup_name', label=Gettext('Host-group', domain='ipa', localedir=None), multivalue=False, normalizer=<lambda>, primary_key=True, query=True, required=False) option: Str('description', attribute=True, autofill=False, cli_name='desc', label=Gettext('Description', domain='ipa', localedir=None), multivalue=False, query=True, required=False) @@ -1501,6 +1501,8 @@ option: List('hostgroup?', cli_name='hostgroups', label=Gettext('host group', do option: List('no_hostgroup?', cli_name='no_hostgroups', label=Gettext('host group', domain='ipa', localedir=None), multivalue=True) option: List('in_hostgroup?', cli_name='in_hostgroups', label=Gettext('host group', domain='ipa', localedir=None), multivalue=True) option: List('not_in_hostgroup?', cli_name='not_in_hostgroups', label=Gettext('host group', domain='ipa', localedir=None), multivalue=True) +option: List('in_netgroup?', cli_name='in_netgroups', label=Gettext('netgroup', domain='ipa', localedir=None), multivalue=True) +option: List('not_in_netgroup?', cli_name='not_in_netgroups', label=Gettext('netgroup', domain='ipa', localedir=None), multivalue=True) option: List('in_hbacrule?', cli_name='in_hbacrules', label=Gettext('HBAC rule', domain='ipa', localedir=None), multivalue=True) option: List('not_in_hbacrule?', cli_name='not_in_hbacrules', label=Gettext('HBAC rule', domain='ipa', localedir=None), multivalue=True) option: List('in_sudorule?', cli_name='in_sudorules', label=Gettext('sudo rule', domain='ipa', localedir=None), multivalue=True) diff --git a/ipalib/plugins/hostgroup.py b/ipalib/plugins/hostgroup.py index a316270fa..d75f381e0 100644 --- a/ipalib/plugins/hostgroup.py +++ b/ipalib/plugins/hostgroup.py @@ -65,7 +65,7 @@ class hostgroup(LDAPObject): uuid_attribute = 'ipauniqueid' attribute_members = { 'member': ['host', 'hostgroup'], - 'memberof': ['hostgroup', 'hbacrule', 'sudorule'], + 'memberof': ['hostgroup', 'netgroup', 'hbacrule', 'sudorule'], 'memberindirect': ['host', 'hostgroup'], 'memberofindirect': ['hostgroup', 'hbacrule', 'sudorule'], } diff --git a/tests/test_xmlrpc/test_hostgroup_plugin.py b/tests/test_xmlrpc/test_hostgroup_plugin.py index e0d115854..6c3b0a41e 100644 --- a/tests/test_xmlrpc/test_hostgroup_plugin.py +++ b/tests/test_xmlrpc/test_hostgroup_plugin.py @@ -83,6 +83,7 @@ class test_hostgroup(Declarative): objectclass=objectclasses.hostgroup, description=[u'Test hostgroup 1'], ipauniqueid=[fuzzy_uuid], + memberof_netgroup=[hostgroup1], mepmanagedentry=lambda x: [DN(i) for i in x] == \ [DN(('cn',hostgroup1),('cn','ng'),('cn','alt'), api.env.basedn)], @@ -146,6 +147,7 @@ class test_hostgroup(Declarative): 'cn': [hostgroup1], 'description': [u'Test hostgroup 1'], 'member_host': [fqdn1], + 'memberof_netgroup': [hostgroup1], }, ), ), @@ -162,6 +164,7 @@ class test_hostgroup(Declarative): 'member_host': [u'testhost1.%s' % api.env.domain], 'cn': [hostgroup1], 'description': [u'Test hostgroup 1'], + 'memberof_netgroup': [hostgroup1], }, ), ), @@ -180,6 +183,7 @@ class test_hostgroup(Declarative): 'member_host': [u'testhost1.%s' % api.env.domain], 'cn': [hostgroup1], 'description': [u'Test hostgroup 1'], + 'memberof_netgroup': [hostgroup1], }, ], ), @@ -198,6 +202,7 @@ class test_hostgroup(Declarative): cn=[hostgroup1], description=[u'Updated hostgroup 1'], member_host=[u'testhost1.%s' % api.env.domain], + memberof_netgroup=[hostgroup1], ), ), ), @@ -214,6 +219,7 @@ class test_hostgroup(Declarative): 'member_host': [u'testhost1.%s' % api.env.domain], 'cn': [hostgroup1], 'description': [u'Updated hostgroup 1'], + 'memberof_netgroup': [hostgroup1], }, ), ), @@ -236,6 +242,7 @@ class test_hostgroup(Declarative): 'dn': lambda x: DN(x) == dn1, 'cn': [hostgroup1], 'description': [u'Updated hostgroup 1'], + 'memberof_netgroup': [hostgroup1], }, ), ), diff --git a/tests/test_xmlrpc/test_nesting.py b/tests/test_xmlrpc/test_nesting.py index cb2d1d0b2..31525cd26 100644 --- a/tests/test_xmlrpc/test_nesting.py +++ b/tests/test_xmlrpc/test_nesting.py @@ -705,6 +705,7 @@ class test_nesting(Declarative): objectclass=objectclasses.hostgroup, description=[u'Test hostgroup 1'], ipauniqueid=[fuzzy_uuid], + memberof_netgroup=[hostgroup1], mepmanagedentry=lambda x: [DN(i) for i in x] == \ [DN(('cn',hostgroup1),('cn','ng'),('cn','alt'), api.env.basedn)], @@ -727,6 +728,7 @@ class test_nesting(Declarative): objectclass=objectclasses.hostgroup, description=[u'Test hostgroup 2'], ipauniqueid=[fuzzy_uuid], + memberof_netgroup=[hostgroup2], mepmanagedentry=lambda x: [DN(i) for i in x] == \ [DN(('cn',hostgroup2),('cn','ng'),('cn','alt'), api.env.basedn)], @@ -753,6 +755,7 @@ class test_nesting(Declarative): 'cn': [hostgroup2], 'description': [u'Test hostgroup 2'], 'member_host': [fqdn1], + 'memberof_netgroup': [hostgroup2], }, ), ), @@ -776,6 +779,7 @@ class test_nesting(Declarative): 'cn': [hostgroup1], 'description': [u'Test hostgroup 1'], 'member_hostgroup': [hostgroup2], + 'memberof_netgroup': [hostgroup1], }, ), ), @@ -791,6 +795,7 @@ class test_nesting(Declarative): 'dn': lambda x: DN(x) == hgdn1, 'memberindirect_host': [u'testhost1.%s' % api.env.domain], 'member_hostgroup': [hostgroup2], + 'memberof_netgroup': [hostgroup1], 'cn': [hostgroup1], 'description': [u'Test hostgroup 1'], }, diff --git a/tests/test_xmlrpc/test_netgroup_plugin.py b/tests/test_xmlrpc/test_netgroup_plugin.py index 9194b5492..f28c667ac 100644 --- a/tests/test_xmlrpc/test_netgroup_plugin.py +++ b/tests/test_xmlrpc/test_netgroup_plugin.py @@ -188,6 +188,7 @@ class test_netgroup(Declarative): cn=[hostgroup1], objectclass=objectclasses.hostgroup, description=[u'Test hostgroup 1'], + memberof_netgroup=[hostgroup1], mepmanagedentry=lambda x: [DN(i) for i in x] == \ [DN(('cn',hostgroup1),('cn','ng'),('cn','alt'), api.env.basedn)], |