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 <dkupka@redhat.com>
This commit is contained in:
Jan Cholasta 2016-04-13 15:49:07 +02:00
parent f28cd62285
commit 1bcf08aab6

View File

@ -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')