From 1517ac6bea3df858a719a0ae1878ed5154d0aee5 Mon Sep 17 00:00:00 2001 From: paperspace-philip <58186049+paperspace-philip@users.noreply.github.com> Date: Sun, 19 Sep 2021 11:51:08 -0400 Subject: [PATCH] Check for empty deployments (#365) --- gradient/cli/gradient_deployments.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gradient/cli/gradient_deployments.py b/gradient/cli/gradient_deployments.py index b9e7304b..c10e34a6 100644 --- a/gradient/cli/gradient_deployments.py +++ b/gradient/cli/gradient_deployments.py @@ -139,6 +139,9 @@ def update_deployment_command(ctx, api_key, id, name, project_id, spec_path, clu def list_deployments_command(ctx, api_key): try: deployments = list_deployments() + if len(deployments) == 0: + print('No deployments found') + return table_data = [('Name', 'ID')] for deployment in deployments: table_data.append((deployment['name'], deployment['id']))