From dd1913c1debbca1361c0752e2d1a6e8e31239a90 Mon Sep 17 00:00:00 2001 From: Gregory Kurtzer Date: Mon, 7 Dec 2020 19:43:56 -0800 Subject: [PATCH] Backend for `container delete` --- internal/pkg/container/vnfs.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/internal/pkg/container/vnfs.go b/internal/pkg/container/vnfs.go index e86b8e45..f81ac344 100644 --- a/internal/pkg/container/vnfs.go +++ b/internal/pkg/container/vnfs.go @@ -77,9 +77,15 @@ func ValidSource(name string) bool { } if util.IsDir(fullPath) == false { - wwlog.Printf(wwlog.WARN, "Location is not a VNFS source directory: %s\n", name) + wwlog.Printf(wwlog.VERBOSE, "Location is not a VNFS source directory: %s\n", name) return false } return true } + +func DeleteSource(name string) error { + fullPath := RootFsDir(name) + + return os.RemoveAll(fullPath) +}