From a4114bb29d3b8468e7497992353ed781067159d9 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Mon, 8 Apr 2019 14:30:50 -0400 Subject: [PATCH] fix: clearing values has no returnable errors --- plugins/resource/subcommands.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/plugins/resource/subcommands.go b/plugins/resource/subcommands.go index 568f0a769..82134fdbc 100644 --- a/plugins/resource/subcommands.go +++ b/plugins/resource/subcommands.go @@ -22,7 +22,8 @@ func CommandLimitClear(args []string, processType string) error { return err } - return clearByRequestType(appName, processType, "limit") + clearByRequestType(appName, processType, "limit") + return nil } // CommandReserve implements resource:reserve @@ -42,10 +43,11 @@ func CommandReserveClear(args []string, processType string) error { return err } - return clearByRequestType(appName, processType, "reserve") + clearByRequestType(appName, processType, "reserve") + return nil } -func clearByRequestType(appName string, processType string, requestType string) error { +func clearByRequestType(appName string, processType string, requestType string) { noun := "limits" if requestType == "reserve" { noun = "reservation" @@ -60,7 +62,7 @@ func clearByRequestType(appName string, processType string, requestType string) if processType == "" { resources, err := common.PropertyGetAll("resource", appName) if err != nil { - return err + return } for key := range resources { common.PropertyDelete("resource", appName, key) @@ -80,7 +82,6 @@ func clearByRequestType(appName string, processType string, requestType string) common.PropertyDelete("resource", appName, property) } } - return nil } func setRequestType(appName string, processType string, r Resource, requestType string) error {