diff options
author | Martin Babinsky <mbabinsk@redhat.com> | 2016-03-08 15:56:52 +0100 |
---|---|---|
committer | Jan Cholasta <jcholast@redhat.com> | 2016-03-24 14:35:19 +0100 |
commit | 7febe569cede47b50a0ee1b19968627716ddbc0d (patch) | |
tree | c1d46084e4dc083074e38b235f28cec5f9537c89 /ipalib/messages.py | |
parent | 2fa09526031b770d6c16aacc76b476d1c3c2e3cb (diff) | |
download | freeipa-7febe569cede47b50a0ee1b19968627716ddbc0d.tar.gz freeipa-7febe569cede47b50a0ee1b19968627716ddbc0d.tar.xz freeipa-7febe569cede47b50a0ee1b19968627716ddbc0d.zip |
otptoken-add: improve the robustness of QR code printing
The python-qrcode print_ascii() method does not work in terminals with
non-UTF-8 encoding. When this is the case do not render QR code but print a
warning instead. Also print a warning when the QR code size is greater that
terminal width if the output is a tty.
https://fedorahosted.org/freeipa/ticket/5700
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
Diffstat (limited to 'ipalib/messages.py')
-rw-r--r-- | ipalib/messages.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ipalib/messages.py b/ipalib/messages.py index dbbc34ab1..5cd0ea176 100644 --- a/ipalib/messages.py +++ b/ipalib/messages.py @@ -352,6 +352,14 @@ class BrokenTrust(PublicMessage): "running 'ipa trust-add' again.") +class ResultFormattingError(PublicMessage): + """ + **13019** Unable to correctly format some part of the result + """ + errno = 13019 + type = "warning" + + def iter_messages(variables, base): """Return a tuple with all subclasses """ |