URL: https://github.com/freeipa/freeipa/pull/1123
Author: Tiboris
 Title: #1123: otptoken_yubikey.py: Removed traceback when package missing.
Action: opened

PR body:
"""
IPA should suggest user to install dependent packages instead
of throwing traceback. To work with IPA and Yubikey, packages
libyubikey(not in official RHEL repo) and libusb are required.

Resolves: https://pagure.io/freeipa/issue/6979
"""

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/1123/head:pr1123
git checkout pr1123
From 88ac1a0f432da6415ab8b80782d8ece2e5637289 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tibor=20Dudl=C3=A1k?= <tdud...@redhat.com>
Date: Fri, 28 Jul 2017 14:46:16 +0200
Subject: [PATCH] otptoken_yubikey.py: Removed traceback when package missing.

IPA should suggest user to install dependent packages instead
of throwing traceback. To work with IPA and Yubikey, packages
libyubikey(not in official RHEL repo) and libusb are required.

Resolves: https://pagure.io/freeipa/issue/6979
---
 ipaclient/plugins/otptoken_yubikey.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/ipaclient/plugins/otptoken_yubikey.py b/ipaclient/plugins/otptoken_yubikey.py
index 60b73a77fc..89ee30da18 100644
--- a/ipaclient/plugins/otptoken_yubikey.py
+++ b/ipaclient/plugins/otptoken_yubikey.py
@@ -131,6 +131,9 @@ def forward(self, *args, **kwargs):
             raise NotFound(reason="No YubiKey found: %s" % e.strerror)
         except yubico.yubikey.YubiKeyError as e:
             raise NotFound(reason=e.reason)
+        except ValueError as e:
+            raise NotFound(reason=str(e) + ". Please install 'libyubikey' "
+                           "and 'libusb' packages first.")
 
         assert yk.version_num() >= (2, 1)
 
_______________________________________________
FreeIPA-devel mailing list -- freeipa-devel@lists.fedorahosted.org
To unsubscribe send an email to freeipa-devel-le...@lists.fedorahosted.org

Reply via email to