diff --git a/client/vos_storage b/client/vos_storage index f64c9d218f87f98df32a22496c194e5292c77d46..aa5214d13966b25cc090ff57852e35a452005e3c 100644 --- a/client/vos_storage +++ b/client/vos_storage @@ -98,10 +98,6 @@ class VOSStorage(AMQPClient): print("! from the database. !") print("! The mount point on the transfer node will not be removed, you !") print("! must do it manually. !") - print("! Anyway, you MUST BE AWARE that all the VOSpace nodes affected !") - print("! by this operation will not be accessible anymore from now on. !") - print("! We strongly recommend to move all the data to another storage !") - print("! location and update the database accordingly. !") print("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!") print() confirm = None @@ -119,8 +115,12 @@ class VOSStorage(AMQPClient): sys.exit("\nFATAL: Malformed response, storage confirmation expected.\n") elif confirmResponse["responseType"] == "STORAGE_DEL_DONE": print("\nStorage location deleted successfully!\n") + elif confirmResponse["responseType"] == "ERROR": + errorCode = confirmResponse["errorCode"] + errorMsg = confirmResponse["errorMsg"] + sys.exit(f"\nError code: {errorCode}\nError message: {errorMsg}\n") else: - sys.exit("FATAL: Unknown response type.\n") + sys.exit("\nFATAL: Unknown response type.\n") elif storeResponse["responseType"] == "ERROR": errorCode = storeResponse["errorCode"] errorMsg = storeResponse["errorMsg"] diff --git a/transfer_service/storage_amqp_server.py b/transfer_service/storage_amqp_server.py index 9a9479d40d1ac4eada22c62ebc77ad2e3ebada57..3cb5eff36c71aaabd7b7169fac71e6ee3f57c97b 100644 --- a/transfer_service/storage_amqp_server.py +++ b/transfer_service/storage_amqp_server.py @@ -69,14 +69,18 @@ class StorageAMQPServer(AMQPServer): if self.storageAck: self.storageAck = False self.dbConn.connect() - self.dbConn.deleteStorage(self.storageId) + result = self.dbConn.deleteStorage(self.storageId) self.dbConn.disconnect() - response = { "responseType": "STORAGE_DEL_DONE" } - + if result: + response = { "responseType": "STORAGE_DEL_DONE" } + else: + response = { "responseType": "ERROR", + "errorCode": 4, + "errorMsg": "This storage location contains some VOSpace nodes. Please, move them to anoter location." } else: response = { "responseType": "ERROR", - "errorCode": 4, + "errorCode": 5, "errorMsg": "Store request not acknowledged." } elif requestBody["requestType"] == "STORAGE_LST": @@ -89,7 +93,7 @@ class StorageAMQPServer(AMQPServer): else: response = { "responseType": "ERROR", - "errorCode": 5, + "errorCode": 6, "errorMsg": "Unkown request type." } return response