def fileserver_auth(self, data): connection_data, port = data result = {} log.msg("[FSRV] Adding new fileserver into DB with IP=%s, PORT=%d" % (connection_data.host, port)) checker = Queries.getFileServerByIpAndPort(connection_data.host, port) if len(checker) == 0: log.msg("[FSRV] Successfully added!") Queries.createNewFileServer(connection_data.host, port) result['errors'] = '' else: log.msg("[FSRV] Files server with IP=%s, PORT=%d already contains at DB" % (connection_data.host, port)) result['errors'] = 'Already exists!' return result