From e7786e182285ff6550a11095c7700fc5871f290b Mon Sep 17 00:00:00 2001 From: lauralani Date: Wed, 15 Mar 2023 17:23:14 +0100 Subject: [PATCH] fix error with subnet deletion checks --- cmd/subnet-delete.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmd/subnet-delete.go b/cmd/subnet-delete.go index ca34787..829e92d 100644 --- a/cmd/subnet-delete.go +++ b/cmd/subnet-delete.go @@ -26,6 +26,11 @@ var subnetdeleteCmd = &cobra.Command{ os.Exit(1) } + if !SubnetExists(subnet) { + fmt.Printf("[ERROR] Couldn't find subnet %v\n", subnet.String()) + os.Exit(1) + } + var confirmation string fmt.Printf("[WARNING] Do you really want to delete subnet %v? [y/N] ", subnet.String()) fmt.Scan(&confirmation)