diff options
author | Nathaniel McCallum <npmccallum@redhat.com> | 2014-11-06 15:30:13 -0500 |
---|---|---|
committer | Petr Vobornik <pvoborni@redhat.com> | 2014-11-19 14:26:00 +0100 |
commit | 3c900ba7a8d98a72ff4e040b688fe3213c722a64 (patch) | |
tree | 9c483cfae1a287662f41e9d51263c77746df7b85 /ipalib/plugins | |
parent | d2ffd176176e20860998d29ede4e9bd65f398bf2 (diff) | |
download | freeipa-3c900ba7a8d98a72ff4e040b688fe3213c722a64.tar.gz freeipa-3c900ba7a8d98a72ff4e040b688fe3213c722a64.tar.xz freeipa-3c900ba7a8d98a72ff4e040b688fe3213c722a64.zip |
Enable QR code display by default in otptoken-add
This is possible because python-qrcode's output now fits in a standard
terminal. Also, update ipa-otp-import and otptoken-add-yubikey to
disable QR code output as it doesn't make sense in these contexts.
https://fedorahosted.org/freeipa/ticket/4703
Reviewed-By: Petr Vobornik <pvoborni@redhat.com>
Diffstat (limited to 'ipalib/plugins')
-rw-r--r-- | ipalib/plugins/otptoken.py | 5 | ||||
-rw-r--r-- | ipalib/plugins/otptoken_yubikey.py | 1 |
2 files changed, 4 insertions, 2 deletions
diff --git a/ipalib/plugins/otptoken.py b/ipalib/plugins/otptoken.py index f48feeee0..f0850854f 100644 --- a/ipalib/plugins/otptoken.py +++ b/ipalib/plugins/otptoken.py @@ -268,7 +268,8 @@ class otptoken_add(LDAPCreate): msg_summary = _('Added OTP token "%(value)s"') takes_options = LDAPCreate.takes_options + ( - Flag('qrcode?', label=_('Display QR code')), + Flag('qrcode?', label=_('(deprecated)'), flags=('no_option')), + Flag('no_qrcode', label=_('Do not display QR code'), default=False), ) has_output_params = LDAPCreate.has_output_params + ( @@ -348,7 +349,7 @@ class otptoken_add(LDAPCreate): rv = super(otptoken_add, self).output_for_cli(textui, output, *args, **options) # Print QR code to terminal if specified - if uri and options.get('qrcode', False): + if uri and not options.get('no_qrcode', False): print "\n" qr = qrcode.QRCode() qr.add_data(uri) diff --git a/ipalib/plugins/otptoken_yubikey.py b/ipalib/plugins/otptoken_yubikey.py index e70ddb6e4..7095887ac 100644 --- a/ipalib/plugins/otptoken_yubikey.py +++ b/ipalib/plugins/otptoken_yubikey.py @@ -124,6 +124,7 @@ class otptoken_add_yubikey(Command): ipatokenotpalgorithm=u'sha1', ipatokenhotpcounter=0, ipatokenotpkey=key, + no_qrcode=True, **options) # Suppress values we don't want to return. |