From: Thierry Parmentelat <thierry.parmentelat@inria.fr>
Date: Tue, 2 Oct 2018 19:33:17 +0000 (+0200)
Subject: smoothen error handling
X-Git-Tag: sfa-4.0-2~6
X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=4c0a4987486224c214ee09289824d197f0af6c10;p=sfa.git

smoothen error handling
---

diff --git a/sfa/trust/auth.py b/sfa/trust/auth.py
index f8ac90f3..b481bbd0 100644
--- a/sfa/trust/auth.py
+++ b/sfa/trust/auth.py
@@ -68,6 +68,8 @@ class Auth:
         error = (None, None)
 
         def log_invalid_cred(cred, exception):
+            if isinstance(cred, dict) and 'geni_value' in cred:
+                cred = cred['geni_value']
             if not isinstance(cred, StringType):
                 logger.info(
                     "{}: cannot validate credential {}"