From 76357283ec522aef8aaf3d3b8eea7155263e3517 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tibor=20Dudl=C3=A1k?= 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 Reviewed-By: Florence Blanc-Renaud --- 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 60b73a77f..89ee30da1 100644 --- a/ipaclient/plugins/otptoken_yubikey.py +++ b/ipaclient/plugins/otptoken_yubikey.py @@ -131,6 +131,9 @@ class otptoken_add_yubikey(Command): 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)