mcclient: 修复project-delete

- Hosts没有project概念,tenant=xx参数会被忽略
 - 指定tenant=xx需要同时指定admin=1才生效
This commit is contained in:
Yousong Zhou
2018-12-06 07:28:00 +00:00
parent a7e4e48a8b
commit aa86ae755e
+2 -1
View File
@@ -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 {