Commit 33298e46 authored by Cristiano Urban's avatar Cristiano Urban
Browse files

Handle empty storage list.

parent cbaa83b3
Loading
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -86,7 +86,7 @@ class VOSStorage(RedisRPCClient):
        elif storageResponse["responseType"] == "STORAGE_DEL_ACK":
            storageList = storageResponse["storageList"]
            if not storageList:
                sys.exit("No storage point found. Please add at least one storage point.\n")
                sys.exit("\nNo storage points found. Please add at least one storage point.\n")
            print("\nSelect the storage location to remove:")
            print("\n" + tabulate(storageList, headers = "keys", tablefmt = "pretty") + "\n")
            storageIdList = []
@@ -143,7 +143,11 @@ class VOSStorage(RedisRPCClient):
        if "responseType" not in storageResponse:
            sys.exit("FATAL: Malformed response, storage acknowledge expected.\n")
        elif storageResponse["responseType"] == "STORAGE_LST_DONE":
            print("\n" + tabulate(storageResponse["storageList"], headers = "keys", tablefmt = "pretty") + "\n")
            storageList = storageResponse["storageList"]
            if storageList:
                print("\n" + tabulate(storageList, headers = "keys", tablefmt = "pretty") + "\n")
            else:
                sys.exit("\nNo storage points found. Please add at least one storage point.\n")
        elif storageResponse["responseType"] == "ERROR":
            errorCode = storageResponse["errorCode"]
            errorMsg = storageResponse["errorMsg"]