From 1bcf08aab69821bea26c288cda02537a110372f8 Mon Sep 17 00:00:00 2001 From: Jan Cholasta Date: Wed, 13 Apr 2016 15:49:07 +0200 Subject: [PATCH] automount: do not inherit automountlocation_import from LDAPQuery automountlocation_import is a client-side command which does not use LDAP directly. Inherit it from Command rather than LDAPQuery and copy its arguments from automountlocation_show. This will make it possible to move automountlocation_import to ipaclient. https://fedorahosted.org/freeipa/ticket/4739 Reviewed-By: David Kupka --- ipalib/plugins/automount.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ipalib/plugins/automount.py b/ipalib/plugins/automount.py index c0a55d5da..1cc94dcd7 100644 --- a/ipalib/plugins/automount.py +++ b/ipalib/plugins/automount.py @@ -24,6 +24,7 @@ import six from ipalib import api, errors from ipalib import Flag, Str, IA5Str +from ipalib.frontend import Command from ipalib.plugable import Registry from ipalib.plugins.baseldap import ( pkey_to_value, @@ -398,7 +399,7 @@ class automountlocation_tofiles(LDAPQuery): @register() -class automountlocation_import(LDAPQuery): +class automountlocation_import(Command): __doc__ = _('Import automount files for a specific location.') takes_args = ( @@ -415,6 +416,12 @@ class automountlocation_import(LDAPQuery): ), ) + def get_args(self): + for arg in self.api.Command.automountlocation_show.args(): + yield arg + for arg in super(automountlocation_import, self).get_args(): + yield arg + def __read_mapfile(self, filename): try: fp = open(filename, 'r')