ipalib: move File command arguments to ipaclient

File arguments are relevant only on the client, on the server they are the
same as Str. Specify the arguments as Str in ipalib.plugins and override
them with File in ipaclient.plugins.

https://fedorahosted.org/freeipa/ticket/4739

Reviewed-By: David Kupka <dkupka@redhat.com>
This commit is contained in:
Jan Cholasta
2016-06-01 15:58:47 +02:00
parent 875801d1d9
commit 2f7df393fd
6 changed files with 51 additions and 8 deletions

View File

@@ -23,11 +23,21 @@ from ipaclient.frontend import CommandOverride
from ipalib import errors
from ipalib import x509
from ipalib import util
from ipalib.parameters import File
from ipalib.plugable import Registry
register = Registry()
@register(override=True)
class cert_request(CommandOverride):
def get_args(self):
for arg in super(cert_request, self).get_args():
if arg.name == 'csr':
arg = arg.clone_retype(arg.name, File)
yield arg
@register(override=True)
class cert_show(CommandOverride):
def forward(self, *keys, **options):