From b12367b4563eb9f80a4a05d724ed7df25fdc6188 Mon Sep 17 00:00:00 2001 From: Mengling Ding Date: Mon, 9 Dec 2024 14:42:54 -0600 Subject: [PATCH] Fix: Simplify checking for existing blades --- cmd/cfm-service/main.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/cmd/cfm-service/main.go b/cmd/cfm-service/main.go index 22135e4..2ef87d4 100644 --- a/cmd/cfm-service/main.go +++ b/cmd/cfm-service/main.go @@ -73,12 +73,7 @@ func main() { data := datastore.DStore().GetDataStore() // Check if there are any devices in the data store - bladeExist := false - for _, appliance := range data.ApplianceData { - if len(appliance.BladeData) != 0 { - bladeExist = true - } - } + bladeExist := len(data.ApplianceData) != 0 hostExist := len(data.HostData) != 0 // If there are no devices in the data store, do discovery, otherwise skip