-
- def __check_authentication(self):
- # just a simple call to check authentication
- def check():
- if (self.node_id and self.key) or self.session:
- try:
- if self.AuthCheck() == 1: return True
- except:
- return False
- return False
- if not check():
- if self.node_id and self.key:
- # if hmac fails, just make it fail
- raise Exception, "Unable to authenticate with hmac"
- else:
- self.__update_session()
- if not check():
- raise Exception, "Unable to authenticate with session"
-
+
+
+ def check_authentication(self):
+ authstatus = False
+ if self.key or self.session:
+ try:
+ authstatus = self.AuthCheck()
+ except:
+ logger.log_exc("plcapi: failed in plcapi.check_authentication")
+ return authstatus
+