def auth_if_required(self):
if self.username is not None and self.password is not None:
try:
logging.debug("Authenticating connection with username: %s" % self.username)
self._conn[self.authdb].authenticate(self.username, self.password)
except OperationFailure, e:
logging.fatal("Unable to authenticate with host %s: %s" % (self.uri, e))
raise DBAuthenticationError(e)
else:
pass
评论列表
文章目录