From ace4f56b19d799302994dc6934b80d20f30a2fd5 Mon Sep 17 00:00:00 2001 From: bixiaoyan Date: Wed, 19 Mar 2025 15:11:06 +0800 Subject: [PATCH] Fix the issue of duplicate parameter information when obtaining metas from Stonith type resources --- models/meta.go | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/models/meta.go b/models/meta.go index e511243..321e65a 100644 --- a/models/meta.go +++ b/models/meta.go @@ -151,19 +151,20 @@ func GetResourceMetas(rscClass, rscType, rscProvider string) map[string]interfac parameters["longdesc"] = "" } prop = append(prop, parameters) - if rscClass == "stonith" { - pcmkHostList := map[string]interface{}{} - content := map[string]string{"default": "", "type": "string"} - pcmkHostList["content"] = content - pcmkHostList["longdesc"] = "A list of machines controlled by this device." - pcmkHostList["name"] = "pcmk_host_list" - pcmkHostList["required"] = "1" - pcmkHostList["shortdesc"] = "" - pcmkHostList["unique"] = "" - pcmkHostList["value"] = "" - prop = append(prop, pcmkHostList) - } } + if rscClass == "stonith" { + pcmkHostList := map[string]interface{}{} + content := map[string]string{"default": "", "type": "string"} + pcmkHostList["content"] = content + pcmkHostList["longdesc"] = "A list of machines controlled by this device." + pcmkHostList["name"] = "pcmk_host_list" + pcmkHostList["required"] = "1" + pcmkHostList["shortdesc"] = "" + pcmkHostList["unique"] = "" + pcmkHostList["value"] = "" + prop = append(prop, pcmkHostList) + } + actionElems := eRoot.FindElements("./actions/action") for _, actionElem := range actionElems { act := map[string]string{} -- Gitee