From aa86ae755ee17834de557cec8588f934555e5f3c Mon Sep 17 00:00:00 2001 From: Yousong Zhou Date: Thu, 6 Dec 2018 07:25:00 +0000 Subject: [PATCH] =?UTF-8?q?mcclient:=20=E4=BF=AE=E5=A4=8Dproject-delete?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Hosts没有project概念,tenant=xx参数会被忽略 - 指定tenant=xx需要同时指定admin=1才生效 --- pkg/mcclient/modules/mod_projects.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/mcclient/modules/mod_projects.go b/pkg/mcclient/modules/mod_projects.go index 5152cdc525..eed02cba3f 100644 --- a/pkg/mcclient/modules/mod_projects.go +++ b/pkg/mcclient/modules/mod_projects.go @@ -241,8 +241,9 @@ func (this *ProjectManagerV3) Delete(session *mcclient.ClientSession, id string, func (this *ProjectManagerV3) DeleteInContexts(session *mcclient.ClientSession, id string, body jsonutils.JSONObject, ctxs []ManagerContext) (jsonutils.JSONObject, error) { if ctxs == nil { p := jsonutils.NewDict() + p.Add(jsonutils.JSONTrue, "admin") p.Add(jsonutils.NewString(id), "tenant") - ret, e := Hosts.List(session, p) + ret, e := Servers.List(session, p) if e != nil { return nil, e } else {