From 837a5ad29c8a946bcc39df7ea6bd5f0b3e677448 Mon Sep 17 00:00:00 2001 From: Roman Skurikhin Date: Mon, 14 Sep 2020 11:22:08 +0300 Subject: [PATCH 1/4] Add disk was removed output --- neuromation/cli/disks.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/neuromation/cli/disks.py b/neuromation/cli/disks.py index a877c0602..0f52c8f81 100644 --- a/neuromation/cli/disks.py +++ b/neuromation/cli/disks.py @@ -1,3 +1,5 @@ +import click + from .formatters.disks import DiskFormatter, DisksFormatter from .formatters.utils import URIFormatter, uri_formatter from .parse_utils import parse_memory @@ -78,8 +80,8 @@ async def rm(root: Root, disk_id: str) -> None: """ Remove disk DISK_ID. """ - await root.client.disks.rm(disk_id) + click.echo(f"Disk with id {disk_id} was successfully removed.") disk.add_command(ls) From f16d835dad5b3460b143cf288749f1493c55055f Mon Sep 17 00:00:00 2001 From: Roman Skurikhin Date: Mon, 14 Sep 2020 11:33:13 +0300 Subject: [PATCH 2/4] Add changelog --- CHANGELOG.D/1738.feature | 1 + 1 file changed, 1 insertion(+) create mode 100644 CHANGELOG.D/1738.feature diff --git a/CHANGELOG.D/1738.feature b/CHANGELOG.D/1738.feature new file mode 100644 index 000000000..07beca2f4 --- /dev/null +++ b/CHANGELOG.D/1738.feature @@ -0,0 +1 @@ +Added output message to `neuro disk rm` for successful removal. \ No newline at end of file From 6a58b596968c5ec77db8de7c449f87dbcfcc1db2 Mon Sep 17 00:00:00 2001 From: Roman Skurikhin Date: Mon, 14 Sep 2020 11:56:03 +0300 Subject: [PATCH 3/4] Add output messages to verbose versions of `rm` commands --- CHANGELOG.D/1738.feature | 2 +- neuromation/cli/disks.py | 3 ++- neuromation/cli/secrets.py | 2 ++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.D/1738.feature b/CHANGELOG.D/1738.feature index 07beca2f4..b7a5d4aa0 100644 --- a/CHANGELOG.D/1738.feature +++ b/CHANGELOG.D/1738.feature @@ -1 +1 @@ -Added output message to `neuro disk rm` for successful removal. \ No newline at end of file +Added output to `neuro disk rm` and `neuro secret rm` when `-v` flag is set. \ No newline at end of file diff --git a/neuromation/cli/disks.py b/neuromation/cli/disks.py index 0f52c8f81..94796fe72 100644 --- a/neuromation/cli/disks.py +++ b/neuromation/cli/disks.py @@ -81,7 +81,8 @@ async def rm(root: Root, disk_id: str) -> None: Remove disk DISK_ID. """ await root.client.disks.rm(disk_id) - click.echo(f"Disk with id {disk_id} was successfully removed.") + if root.verbosity > 0: + click.echo(f"Disk with id: '{disk_id}' was successfully removed.") disk.add_command(ls) diff --git a/neuromation/cli/secrets.py b/neuromation/cli/secrets.py index 575f2e359..ad301be82 100644 --- a/neuromation/cli/secrets.py +++ b/neuromation/cli/secrets.py @@ -51,6 +51,8 @@ async def rm(root: Root, key: str) -> None: """ await root.client.secrets.rm(key) + if root.verbosity > 0: + click.echo(f"Secret with key: '{key}' was successfully removed") secret.add_command(ls) From d8e6a38af7eb7652a63e14a086604162e60405fd Mon Sep 17 00:00:00 2001 From: Roman Skurikhin Date: Mon, 14 Sep 2020 12:44:04 +0300 Subject: [PATCH 4/4] Remove unneeded ":" symbol --- neuromation/cli/disks.py | 2 +- neuromation/cli/secrets.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/neuromation/cli/disks.py b/neuromation/cli/disks.py index 94796fe72..ccb0c72e0 100644 --- a/neuromation/cli/disks.py +++ b/neuromation/cli/disks.py @@ -82,7 +82,7 @@ async def rm(root: Root, disk_id: str) -> None: """ await root.client.disks.rm(disk_id) if root.verbosity > 0: - click.echo(f"Disk with id: '{disk_id}' was successfully removed.") + click.echo(f"Disk with id '{disk_id}' was successfully removed.") disk.add_command(ls) diff --git a/neuromation/cli/secrets.py b/neuromation/cli/secrets.py index ad301be82..3e43adcb9 100644 --- a/neuromation/cli/secrets.py +++ b/neuromation/cli/secrets.py @@ -52,7 +52,7 @@ async def rm(root: Root, key: str) -> None: await root.client.secrets.rm(key) if root.verbosity > 0: - click.echo(f"Secret with key: '{key}' was successfully removed") + click.echo(f"Secret with key '{key}' was successfully removed") secret.add_command(ls)