summaryrefslogtreecommitdiffstats
path: root/ipaclient
diff options
context:
space:
mode:
authorJan Cholasta <jcholast@redhat.com>2016-06-01 15:58:47 +0200
committerJan Cholasta <jcholast@redhat.com>2016-06-03 09:00:34 +0200
commit2f7df393fd17b115112c39c714cc6c9b0b37460c (patch)
tree721c48e80f6511c39ab80fc8076f49fef1a2c63b /ipaclient
parent875801d1d9406af6bcd4281962121f04b90287b7 (diff)
downloadfreeipa-2f7df393fd17b115112c39c714cc6c9b0b37460c.tar.gz
freeipa-2f7df393fd17b115112c39c714cc6c9b0b37460c.tar.xz
freeipa-2f7df393fd17b115112c39c714cc6c9b0b37460c.zip
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>
Diffstat (limited to 'ipaclient')
-rw-r--r--ipaclient/plugins/cert.py10
-rw-r--r--ipaclient/plugins/certprofile.py19
-rw-r--r--ipaclient/plugins/migration.py7
3 files changed, 36 insertions, 0 deletions
diff --git a/ipaclient/plugins/cert.py b/ipaclient/plugins/cert.py
index 722743e2f..1b840ace9 100644
--- a/ipaclient/plugins/cert.py
+++ b/ipaclient/plugins/cert.py
@@ -23,12 +23,22 @@ 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):
if 'out' in options:
diff --git a/ipaclient/plugins/certprofile.py b/ipaclient/plugins/certprofile.py
index 4fe1026d0..f36f27128 100644
--- a/ipaclient/plugins/certprofile.py
+++ b/ipaclient/plugins/certprofile.py
@@ -4,6 +4,7 @@
from ipaclient.frontend import MethodOverride
from ipalib import util
+from ipalib.parameters import File
from ipalib.plugable import Registry
from ipalib.text import _
@@ -26,3 +27,21 @@ class certprofile_show(MethodOverride):
)
return result
+
+
+@register(override=True)
+class certprofile_import(MethodOverride):
+ def get_options(self):
+ for option in super(certprofile_import, self).get_options():
+ if option.name == 'file':
+ option = option.clone_retype(option.name, File)
+ yield option
+
+
+@register(override=True)
+class certprofile_mod(MethodOverride):
+ def get_options(self):
+ for option in super(certprofile_mod, self).get_options():
+ if option.name == 'file':
+ option = option.clone_retype(option.name, File)
+ yield option
diff --git a/ipaclient/plugins/migration.py b/ipaclient/plugins/migration.py
index 1a184b963..b40ddfd80 100644
--- a/ipaclient/plugins/migration.py
+++ b/ipaclient/plugins/migration.py
@@ -20,6 +20,7 @@
import six
from ipaclient.frontend import CommandOverride
+from ipalib.parameters import File
from ipalib.plugable import Registry
from ipalib import _
@@ -43,6 +44,12 @@ with clear text passwords. All migrated users need to
login at https://your.domain/ipa/migration/ before they
can use their Kerberos accounts.''')
+ def get_options(self):
+ for option in super(migrate_ds, self).get_options():
+ if option.name == 'cacertfile':
+ option = option.clone_retype(option.name, File)
+ yield option
+
def output_for_cli(self, textui, result, ldapuri, bindpw, **options):
textui.print_name(self.name)
if not result['enabled']: