Commit 35bdb84e authored by Cristiano Urban's avatar Cristiano Urban
Browse files

Fixed 'Service busy' message when there is no job running and the 'store' dir is empty.

parent 6bb14521
Loading
Loading
Loading
Loading
+10 −6
Original line number Diff line number Diff line
@@ -77,13 +77,17 @@ class StoreAMQPServer(AMQPServer):
                        response = { "responseType": "STORE_ACK",
                                     "storageList": storageList }
                        self.storeAck = True
                    else:
                    elif os.access(folderPath, os.W_OK) and not os.listdir(folderPath):
                        response = { "responseType": "ERROR",
                                     "errorCode": 3,
                                     "errorMsg": "Service busy." }
                                     "errorMsg": "The 'store' directory on the transfer node is empty." }
                    else:
                        response = { "responseType": "ERROR",
                                     "errorCode": 4,
                                     "errorMsg": "Service busy. Please, retry later." }
                else:
                    response = { "responseType": "ERROR",
                                 "errorCode": 5,
                                 "errorMsg": "Permission denied." }
        elif requestBody["requestType"] == "STORE_CON":
            if self.storeAck:
@@ -99,18 +103,18 @@ class StoreAMQPServer(AMQPServer):
                self.pendingQueueWrite.insertJob(self.job)
                if "error" in dbResponse:
                    response = { "responseType": "ERROR",
                                 "errorCode": 5,
                                 "errorCode": 6,
                                 "errorMsg": "Job creation failed." }
                else:
                    response = { "responseType": "STORE_RUN", 
                                 "jobId": self.job.jobId }
            else:
                response = { "responseType": "ERROR",
                             "errorCode": 6,
                             "errorCode": 7,
                             "errorMsg": "Store request not acknowledged." }
        else:
            response = { "responseType": "ERROR",
                         "errorCode": 7,
                         "errorCode": 8,
                         "errorMsg": "Unkown request type." }

        return response