diff options
author | Rob Crittenden <rcritten@redhat.com> | 2008-11-04 16:21:10 -0500 |
---|---|---|
committer | Rob Crittenden <rcritten@redhat.com> | 2008-11-04 16:21:10 -0500 |
commit | e8adb59fd42eddb9f8911f6d888d9a64e0773df9 (patch) | |
tree | 133a5dc66d2479b86aed81bbc12e695445c6d297 /ipalib | |
parent | 906e75b7afc11d6546e67870d722b21b273f54fa (diff) | |
download | freeipa-e8adb59fd42eddb9f8911f6d888d9a64e0773df9.tar.gz freeipa-e8adb59fd42eddb9f8911f6d888d9a64e0773df9.tar.xz freeipa-e8adb59fd42eddb9f8911f6d888d9a64e0773df9.zip |
Fix some problems uncovered during automation test work
Diffstat (limited to 'ipalib')
-rw-r--r-- | ipalib/plugins/f_automount.py | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/ipalib/plugins/f_automount.py b/ipalib/plugins/f_automount.py index 78e96ccdf..fba9e12c4 100644 --- a/ipalib/plugins/f_automount.py +++ b/ipalib/plugins/f_automount.py @@ -180,7 +180,8 @@ api.register(automount_delmap) class automount_delkey(crud.Del): 'Delete an automount key.' takes_options = ( - Param('key', + Param('automountkey', + cli_name='key', doc='The automount key to remove'), ) def execute(self, mapname, **kw): @@ -195,7 +196,7 @@ class automount_delkey(crud.Del): dn = ldap.find_entry_dn("automountmapname", mapname, "automountmap") keys = api.Command['automount_getkeys'](mapname) keydn = None - keyname = kw.get('key').lower() + keyname = kw.get('automountkey').lower() if keys: for k in keys: if k.get('automountkey').lower() == keyname: @@ -336,6 +337,10 @@ class automount_findkey(crud.Find): takes_options = ( Param('all?', type=ipa_types.Bool(), doc='Retrieve all attributes'), ) + def get_args(self): + return (Param('automountkey', + cli_name='key', + doc='An entry in an automount map'),) def execute(self, term, **kw): ldap = self.api.Backend.ldap @@ -399,7 +404,8 @@ api.register(automount_showmap) class automount_showkey(crud.Get): 'Examine an existing automount key.' takes_options = ( - Param('key', + Param('automountkey', + cli_name='key', doc='The automount key to display'), Param('all?', type=ipa_types.Bool(), doc='Retrieve all attributes'), ) @@ -410,13 +416,13 @@ class automount_showkey(crud.Get): Returns the entry :param mapname: The mapname to examine - :param kw: "key" the key to retrieve + :param kw: "automountkey" the key to retrieve :param kw: "all" set to True = return all attributes """ ldap = self.api.Backend.ldap dn = ldap.find_entry_dn("automountmapname", mapname, "automountmap") keys = api.Command['automount_getkeys'](mapname) - keyname = kw.get('key').lower() + keyname = kw.get('automountkey').lower() keydn = None if keys: for k in keys: @@ -463,7 +469,12 @@ class automount_getkeys(frontend.Command): """ ldap = self.api.Backend.ldap dn = ldap.find_entry_dn("automountmapname", mapname, "automountmap") - return ldap.get_one_entry(dn, 'objectclass=*', ['automountkey']) + try: + keys = ldap.get_one_entry(dn, 'objectclass=*', ['automountkey']) + except errors.NotFound: + keys = [] + + return keys def output_for_cli(self, keys): if keys: for k in keys: |