summaryrefslogtreecommitdiffstats
path: root/ipalib
diff options
context:
space:
mode:
authorJason Gerard DeRose <jderose@redhat.com>2009-01-14 22:10:09 -0700
committerJason Gerard DeRose <jderose@redhat.com>2009-01-14 22:10:09 -0700
commit64c072b7b3deb1800c242b365e277591f056093d (patch)
treea93c9ca1c6cbd4023760d0d3c010a524062d11cb /ipalib
parentec14fbfbc5f822490ed5266f1b0a8eb110a13a98 (diff)
downloadfreeipa-64c072b7b3deb1800c242b365e277591f056093d.tar.gz
freeipa-64c072b7b3deb1800c242b365e277591f056093d.tar.xz
freeipa-64c072b7b3deb1800c242b365e277591f056093d.zip
Updated hostgroup plugins module to where it can at least be imported
Diffstat (limited to 'ipalib')
-rw-r--r--ipalib/plugins/f_hostgroup.py34
1 files changed, 16 insertions, 18 deletions
diff --git a/ipalib/plugins/f_hostgroup.py b/ipalib/plugins/f_hostgroup.py
index 3e14b09a2..c365c918e 100644
--- a/ipalib/plugins/f_hostgroup.py
+++ b/ipalib/plugins/f_hostgroup.py
@@ -21,12 +21,10 @@
Frontend plugins for groups of hosts
"""
-from ipalib import frontend
-from ipalib import crud
-from ipalib.frontend import Param
-from ipalib import api
-from ipalib import errors
-from ipalib import ipa_types
+from ipalib import api, crud, errors
+from ipalib import Object, Command # Plugin base classes
+from ipalib import Str # Parameter types
+
hostgroup_filter = "groupofnames)(!(objectclass=posixGroup)"
@@ -43,18 +41,18 @@ def get_members(members):
return members
-class hostgroup(frontend.Object):
+class hostgroup(Object):
"""
Host Group object.
"""
takes_params = (
- Param('description',
+ Str('description',
doc='A description of this group',
),
- Param('cn',
+ Str('cn',
cli_name='name',
primary_key=True,
- normalize=lambda value: value.lower(),
+ normalizer=lambda value: value.lower(),
)
)
api.register(hostgroup)
@@ -220,14 +218,14 @@ class hostgroup_show(crud.Get):
api.register(hostgroup_show)
-class hostgroup_add_member(frontend.Command):
+class hostgroup_add_member(Command):
'Add a member to a group.'
takes_args = (
- Param('group', primary_key=True),
+ Str('group', primary_key=True),
)
takes_options = (
- Param('groups?', doc='comma-separated list of host groups to add'),
- Param('hosts?', doc='comma-separated list of hosts to add'),
+ Str('groups?', doc='comma-separated list of host groups to add'),
+ Str('hosts?', doc='comma-separated list of hosts to add'),
)
def execute(self, cn, **kw):
"""
@@ -288,14 +286,14 @@ class hostgroup_add_member(frontend.Command):
api.register(hostgroup_add_member)
-class hostgroup_remove_member(frontend.Command):
+class hostgroup_remove_member(Command):
'Remove a member from a group.'
takes_args = (
- Param('group', primary_key=True),
+ Str('group', primary_key=True),
)
takes_options = (
- Param('hosts?', doc='comma-separated list of hosts to add'),
- Param('groups?', doc='comma-separated list of groups to remove'),
+ Str('hosts?', doc='comma-separated list of hosts to add'),
+ Str('groups?', doc='comma-separated list of groups to remove'),
)
def execute(self, cn, **kw):
"""