Loading client/vos_group +16 −7 Original line number Diff line number Diff line Loading @@ -48,7 +48,7 @@ class VOSGroup(RedisRPCClient): delGroupRequest = { "requestType": requestType, "vospacePath": vospacePath, "groupName": groupname } delGroupResponse = self.call(delGroupRequest) if "responseType" not in delGroupResponse: sys.exit("FATAL: Malformed response, storage acknowledge expected.\n") sys.exit("FATAL: Malformed response.\n") elif delGroupResponse["responseType"] == "GRPR_STARTED": print("\nThe procedure that removes the group from 'group_read' has started.\nYou'll receive an email at the end of the operation.\n") elif delGroupResponse["responseType"] == "GRPW_STARTED": Loading @@ -67,12 +67,21 @@ class VOSGroup(RedisRPCClient): requestType = "GRPW_LST" listGroupsRequest = { "requestType": requestType, "vospacePath": vospacePath } listGroupsResponse = self.call(listGroupsRequest) if "responseType" not in listGroupsResponse: sys.exit("FATAL: Malformed response.\n") elif listGroupsResponse["responseType"] == "GRPR_LST_DONE" or listGroupsResponse["responseType"] == "GRPW_LST_DONE": groupList = listGroupsResponse["groupList"] if not groupList: sys.exit(f"\n'group_{groupType}' is empty.\n") print() print(tabulate(groupList, headers = "keys", tablefmt = "pretty")) print() elif listGroupsResponse["responseType"] == "ERROR": errorCode = listGroupsResponse["errorCode"] errorMsg = listGroupsResponse["errorMsg"] sys.exit(f"\nError code: {errorCode}\nError message: {errorMsg}\n") else: sys.exit("\nFATAL: Unknown response type.\n") def help(self): sys.exit(""" Loading transfer_service/group_rw_rpc_server.py +19 −16 Original line number Diff line number Diff line Loading @@ -7,7 +7,6 @@ from db_connector import DbConnector from job_queue import JobQueue from job import Job from redis_rpc_server import RedisRPCServer from system_utils import SystemUtils class GroupRwRPCServer(RedisRPCServer): Loading Loading @@ -39,7 +38,6 @@ class GroupRwRPCServer(RedisRPCServer): self.logger.addHandler(logFileHandler) self.logger.addHandler(logStreamHandler) self.groupRwReadyQueue = JobQueue("group_rw_ready") self.systemUtils = SystemUtils() super(GroupRwRPCServer, self).__init__(host, port, db, rpcQueue) def callback(self, requestBody): Loading @@ -56,10 +54,6 @@ class GroupRwRPCServer(RedisRPCServer): jobType = requestType.split('_')[0] vospacePath = requestBody["vospacePath"] groupname = requestBody["groupName"] self.logger.info(f"groupName: {groupname}") creatorId = self.dbConn.getCreatorId(vospacePath) self.logger.info(f"creatorId: {creatorId}") if not self.dbConn.nodeExists(vospacePath): response = { "responseType": "ERROR", Loading @@ -75,21 +69,30 @@ class GroupRwRPCServer(RedisRPCServer): jobInfo = requestBody.copy() jobObj.setInfo(jobInfo) jobObj.setPhase("QUEUED") creatorId = self.dbConn.getCreatorId(vospacePath) jobObj.setOwnerId(creatorId) self.dbConn.insertJob(jobObj) self.groupRwReadyQueue.insertJob(jobObj) response = { "responseType": f"{jobType}_STARTED" } elif requestBody["requestType"] == "GRPR_LST": vospacePath = requestBody["vospacePath"] if not self.dbConn.nodeExists(vospacePath): response = { "responseType": "ERROR", "errorCode": 2, "errorMsg": "VOSpace path not found." } else: result = self.dbConn.getGroupRead(vospacePath) response = { "responseType": "GRPR_LST_DONE", "groupList": result } elif requestBody["requestType"] == "GRPW_LST": vospacePath = requestBody["vospacePath"] if not self.dbConn.nodeExists(vospacePath): response = { "responseType": "ERROR", "errorCode": 2, "errorMsg": "VOSpace path not found." } else: result = self.dbConn.getGroupWrite(vospacePath) response = { "responseType": "GRPW_LST_DONE", "groupList": result } else: Loading Loading
client/vos_group +16 −7 Original line number Diff line number Diff line Loading @@ -48,7 +48,7 @@ class VOSGroup(RedisRPCClient): delGroupRequest = { "requestType": requestType, "vospacePath": vospacePath, "groupName": groupname } delGroupResponse = self.call(delGroupRequest) if "responseType" not in delGroupResponse: sys.exit("FATAL: Malformed response, storage acknowledge expected.\n") sys.exit("FATAL: Malformed response.\n") elif delGroupResponse["responseType"] == "GRPR_STARTED": print("\nThe procedure that removes the group from 'group_read' has started.\nYou'll receive an email at the end of the operation.\n") elif delGroupResponse["responseType"] == "GRPW_STARTED": Loading @@ -67,12 +67,21 @@ class VOSGroup(RedisRPCClient): requestType = "GRPW_LST" listGroupsRequest = { "requestType": requestType, "vospacePath": vospacePath } listGroupsResponse = self.call(listGroupsRequest) if "responseType" not in listGroupsResponse: sys.exit("FATAL: Malformed response.\n") elif listGroupsResponse["responseType"] == "GRPR_LST_DONE" or listGroupsResponse["responseType"] == "GRPW_LST_DONE": groupList = listGroupsResponse["groupList"] if not groupList: sys.exit(f"\n'group_{groupType}' is empty.\n") print() print(tabulate(groupList, headers = "keys", tablefmt = "pretty")) print() elif listGroupsResponse["responseType"] == "ERROR": errorCode = listGroupsResponse["errorCode"] errorMsg = listGroupsResponse["errorMsg"] sys.exit(f"\nError code: {errorCode}\nError message: {errorMsg}\n") else: sys.exit("\nFATAL: Unknown response type.\n") def help(self): sys.exit(""" Loading
transfer_service/group_rw_rpc_server.py +19 −16 Original line number Diff line number Diff line Loading @@ -7,7 +7,6 @@ from db_connector import DbConnector from job_queue import JobQueue from job import Job from redis_rpc_server import RedisRPCServer from system_utils import SystemUtils class GroupRwRPCServer(RedisRPCServer): Loading Loading @@ -39,7 +38,6 @@ class GroupRwRPCServer(RedisRPCServer): self.logger.addHandler(logFileHandler) self.logger.addHandler(logStreamHandler) self.groupRwReadyQueue = JobQueue("group_rw_ready") self.systemUtils = SystemUtils() super(GroupRwRPCServer, self).__init__(host, port, db, rpcQueue) def callback(self, requestBody): Loading @@ -56,10 +54,6 @@ class GroupRwRPCServer(RedisRPCServer): jobType = requestType.split('_')[0] vospacePath = requestBody["vospacePath"] groupname = requestBody["groupName"] self.logger.info(f"groupName: {groupname}") creatorId = self.dbConn.getCreatorId(vospacePath) self.logger.info(f"creatorId: {creatorId}") if not self.dbConn.nodeExists(vospacePath): response = { "responseType": "ERROR", Loading @@ -75,21 +69,30 @@ class GroupRwRPCServer(RedisRPCServer): jobInfo = requestBody.copy() jobObj.setInfo(jobInfo) jobObj.setPhase("QUEUED") creatorId = self.dbConn.getCreatorId(vospacePath) jobObj.setOwnerId(creatorId) self.dbConn.insertJob(jobObj) self.groupRwReadyQueue.insertJob(jobObj) response = { "responseType": f"{jobType}_STARTED" } elif requestBody["requestType"] == "GRPR_LST": vospacePath = requestBody["vospacePath"] if not self.dbConn.nodeExists(vospacePath): response = { "responseType": "ERROR", "errorCode": 2, "errorMsg": "VOSpace path not found." } else: result = self.dbConn.getGroupRead(vospacePath) response = { "responseType": "GRPR_LST_DONE", "groupList": result } elif requestBody["requestType"] == "GRPW_LST": vospacePath = requestBody["vospacePath"] if not self.dbConn.nodeExists(vospacePath): response = { "responseType": "ERROR", "errorCode": 2, "errorMsg": "VOSpace path not found." } else: result = self.dbConn.getGroupWrite(vospacePath) response = { "responseType": "GRPW_LST_DONE", "groupList": result } else: Loading