def SetupDataStore(): global PORT if PORT: return PORT = [portpicker.PickUnusedPort(), portpicker.PickUnusedPort()] _SetConfig() _StartServers() try: data_store.DB = http_data_store.HTTPDataStore() except http_data_store.HTTPDataStoreError: data_store.DB = None _CloseServer()
def SetupDataStore(self): global PORT if PORT: return PORT = portpicker.PickUnusedPort() self._SetConfig(self.temp_dir) _StartServer(self.temp_dir) try: data_store.DB = http_data_store.HTTPDataStore() except http_data_store.HTTPDataStoreError as e: data_store.DB = None _CloseServer() self.fail("Error: %s" % str(e))
def InitDatastore(self): global PORT if not PORT: PORT = 7000 _SetConfig(self.temp_dir) if not STARTED_SERVER: _StartServer(self.temp_dir) else: # Change location of the database. HTTP_DB.ChangeLocation(self.temp_dir) try: data_store.DB = http_data_store.HTTPDataStore() except http_data_store.HTTPDataStoreError as e: data_store.DB = None _CloseServer() self.fail("Error: %s" % str(e)) self.old_security_manager = None