- if xrns is None: xrns=[]
- def log_invalid_cred(cred):
- if not isinstance (cred, StringTypes):
- logger.info("cannot validate credential %s - expecting a string"%cred)
- error="checkCredentials: expected a string, received %s"%(type(cred))
+ 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))