summaryrefslogtreecommitdiffstats
path: root/ipalib
diff options
context:
space:
mode:
authorRob Crittenden <rcritten@redhat.com>2010-02-12 16:27:52 -0500
committerJason Gerard DeRose <jderose@redhat.com>2010-02-15 12:44:28 -0700
commit99dcf9d4f97ac8bff112d6ccc36bb5b894fa5bcd (patch)
treeb4eed29d65192f75e8c712b4394b646e72ec8f63 /ipalib
parenta63224f4dced1f81eee1f2fe99dbfd4c8c25a083 (diff)
downloadfreeipa-99dcf9d4f97ac8bff112d6ccc36bb5b894fa5bcd.tar.gz
freeipa-99dcf9d4f97ac8bff112d6ccc36bb5b894fa5bcd.tar.xz
freeipa-99dcf9d4f97ac8bff112d6ccc36bb5b894fa5bcd.zip
Fix the automountlocation-tofiles command and add some labels
Diffstat (limited to 'ipalib')
-rw-r--r--ipalib/plugins/automount.py26
1 files changed, 18 insertions, 8 deletions
diff --git a/ipalib/plugins/automount.py b/ipalib/plugins/automount.py
index 8037b9aa8..c56c7daf9 100644
--- a/ipalib/plugins/automount.py
+++ b/ipalib/plugins/automount.py
@@ -107,6 +107,7 @@ class automountlocation(LDAPObject):
takes_params = (
Str('cn',
cli_name='location',
+ label='Location',
doc='automount location name',
primary_key=True,
),
@@ -162,37 +163,44 @@ class automountlocation_tofiles(LDAPQuery):
ldap = self.obj.backend
maps = []
- (maps, truncated) = self.api.Command['automountkey_find'](
+ result = self.api.Command['automountkey_find'](
cn=args[0], automountmapname=u'auto.master'
)
+ truncated = result['truncated']
+ maps = result['result']
+
+ # maps, truncated
# TODO: handle truncated results
# ?use ldap.find_entries instead of automountkey_find?
keys = {}
- for (dn, m) in maps:
+ for m in maps:
info = m['automountinformation'][0]
- (keys[info], truncated) = self.api.Command['automountkey_find'](
+ result = self.api.Command['automountkey_find'](
cn=args[0], automountmapname=info
)
+ truncated = result['truncated']
+ keys[info] = result['result']
# TODO: handle truncated results, same as above
- return (maps, keys)
+ return dict(result=dict(maps=maps, keys=keys))
def output_for_cli(self, textui, result, *keys, **options):
- (maps, keys) = result
+ maps = result['result']['maps']
+ keys = result['result']['keys']
textui.print_plain('/etc/auto.master:')
- for (dn, m) in maps:
+ for m in maps:
textui.print_plain(
'%s\t/etc/%s' % (
m['automountkey'][0], m['automountinformation'][0]
)
)
- for (dn, m) in maps:
+ for m in maps:
info = m['automountinformation'][0]
textui.print_plain('---------------------------')
textui.print_plain('/etc/%s:' % info)
- for (dn, k) in keys[info]:
+ for k in keys[info]:
textui.print_plain(
'%s\t%s' % (
k['automountkey'][0], k['automountinformation'][0]
@@ -219,11 +227,13 @@ class automountmap(LDAPObject):
takes_params = (
Str('automountmapname',
cli_name='map',
+ label='Map',
primary_key=True,
doc='automount map name',
),
Str('description?',
cli_name='desc',
+ label='Description',
doc='description',
),
)