Commit 2631c099 authored by Cristiano Urban's avatar Cristiano Urban
Browse files

Added jobID print + minor changes on CLI output format.

parent 89167344
Loading
Loading
Loading
Loading
+11 −9
Original line number Diff line number Diff line
@@ -61,10 +61,10 @@ DESCRIPTION
    def store(self, cmd, username):
        request_type = cmd.upper()
        storeRequest = { "requestType": request_type, "userName": username }
        print(f"Sending {request_type} request...")
        print(f"\nSending {request_type} request...")
        storeResponse = self.call(storeRequest)
        if "responseType" not in storeResponse:
            sys.exit("FATAL: Malformed response, store acknowledge expected.")
            sys.exit("FATAL: Malformed response, store acknowledge expected.\n")
        elif storeResponse["responseType"] == "STORE_ACK":
            print("\nWARNING!!! WARNING!!! WARNING!!! WARNING!!! WARNING!!!")
            print("If you confirm, all your data on the transfer node will be")
@@ -77,20 +77,22 @@ DESCRIPTION
            if confirm == "yes":
                confirmRequest = { "requestType": "STORE_CON", "userName": username }
                confirmResponse = self.call(confirmRequest)
                if "responseType" not in storeResponse:
                    sys.exit("FATAL: Malformed response, store confirmation expected.")
                if "responseType" not in confirmResponse:
                    sys.exit("\nFATAL: Malformed response, store confirmation expected.\n")
                elif confirmResponse["responseType"] == "STORE_RUN":
                    print("Store process started successfully!")
                    jobID = confirmResponse["jobID"]
                    print(f"\nJobID = {jobID}")
                    print("Store process started successfully!\n")
                else:
                    sys.exit("FATAL: Unknown response type.")
                    sys.exit("FATAL: Unknown response type.\n")
            else:
                sys.exit("Store process aborted gracefully.")
                sys.exit("\nStore process aborted gracefully.\n")
        elif storeResponse["responseType"] == "ERROR":
            errorCode = storeResponse["errorCode"]
            errorMsg = storeResponse["errorMsg"]
            sys.exit(f"Error code: {errorCode}, Error message: {errorMsg}")
            sys.exit(f"Error code: {errorCode}, Error message: {errorMsg}\n")
        else:
            sys.exit("FATAL: Unknown response type.")
            sys.exit("\nFATAL: Unknown response type.\n")


# Create new AMQPClient object