- if xrns is None: xrns=[]
- def log_invalid_cred(cred):
- cred_obj=Credential(string=cred)
- logger.debug("failed to validate credential - dump=%s"%cred_obj.dump_string(dump_parents=True))
- error = sys.exc_info()[:2]
+ if xrns is None:
+ xrns = []
+ error = (None, None)
+
+ def log_invalid_cred(cred, exception):
+ if not isinstance(cred, StringType):
+ logger.info(
+ "{}: cannot validate credential {}"
+ .format(exception, cred))
+ error = ('TypeMismatch',
+ "checkCredentials: expected a string, got {} -- {}"
+ .format(type(cred), cred))
+ else:
+ cred_obj = Credential(string=cred)
+ logger.info("{}: failed to validate credential dump={}"
+ .format(exception,
+ cred_obj.dump_string(dump_parents=True)))
+ error = sys.exc_info()[:2]