summaryrefslogtreecommitdiffstats
path: root/ipaclient/plugins
diff options
context:
space:
mode:
authorDavid Kupka <dkupka@redhat.com>2017-05-12 17:17:05 +0200
committerMartin Basti <mbasti@redhat.com>2017-05-16 11:39:43 +0200
commite415da22f350fbda5b8b341bf2dc5f969cecb84a (patch)
tree495c21a20fbe594d159bb4d28b6ae73a8f9d9a9b /ipaclient/plugins
parent374a58fa49adc715d50996571631af37ae16bd64 (diff)
otptoken-add-yubikey: When --digits not provided use default value
Since Thin client was introduced default values for options are not populated in client side plugins. When option has default value and is needed in client plugin it must be handled by explicitly. https://pagure.io/freeipa/issue/6900 Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
Diffstat (limited to 'ipaclient/plugins')
-rw-r--r--ipaclient/plugins/otptoken_yubikey.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/ipaclient/plugins/otptoken_yubikey.py b/ipaclient/plugins/otptoken_yubikey.py
index 9993ec881..60b73a77f 100644
--- a/ipaclient/plugins/otptoken_yubikey.py
+++ b/ipaclient/plugins/otptoken_yubikey.py
@@ -147,7 +147,10 @@ class otptoken_add_yubikey(Command):
# Write the config.
cfg = yk.init_config()
- cfg.mode_oath_hotp(key, kwargs['ipatokenotpdigits'])
+ cfg.mode_oath_hotp(key, kwargs.get(
+ 'ipatokenotpdigits',
+ self.get_default_of('ipatokenotpdigits')
+ ))
cfg.extended_flag('SERIAL_API_VISIBLE', True)
yk.write_config(cfg, slot=kwargs['slot'])