def _authenticate(self, attempts=25):
        """
		Attempts to authenticate N times
		
		@attempts(optional): number of attempts to authenticate
		"""
        for i in range(attempts):
            s = BQSession().init_cas(self.username, self.password, bisque_root=self.bisque_root)
            try:
                if s._check_session():
                    self._debug_print("Authenticated successfully!")
                    return s
            except:
                self._debug_print("Unable to authenticate... trying again")
                pass
            time.sleep(30)

        self._debug_print("Unable to authenticate.", "error")
        return None
Exemple #2
0
	def _authenticate(self, attempts=25):
		'''
		Attempts to authenticate N times
		
		@attempts(optional): number of attempts to authenticate
		'''
		for i in range(attempts):
			s = BQSession().init_cas(self.username, self.password, bisque_root=self.bisque_root)
			try:
				if s._check_session():
					self._debug_print('Authenticated successfully!')
					return s
			except:
				self._debug_print('Unable to authenticate... trying again')
				pass
			time.sleep(30)
			
		self._debug_print('Unable to authenticate.', 'error')
		return None