From c66e264affe3cded46073737d63591886c07cf68 Mon Sep 17 00:00:00 2001 From: Yousong Zhou Date: Wed, 12 Sep 2018 05:24:32 +0000 Subject: [PATCH] cloudcommon: virtualresource: show pending_deleted field when queried --- pkg/cloudcommon/db/virtualresource.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkg/cloudcommon/db/virtualresource.go b/pkg/cloudcommon/db/virtualresource.go index 088010f579..6a69bc84bf 100644 --- a/pkg/cloudcommon/db/virtualresource.go +++ b/pkg/cloudcommon/db/virtualresource.go @@ -176,6 +176,14 @@ func (model *SVirtualResourceBase) getMoreDetails(ctx context.Context, userCred log.Errorf("GetTenantCache fail %s", err) } } + admin, _ := query.GetString("admin") + if utils.ToBool(admin) { // admin + pendingDelete, _ := query.GetString("pending_delete") + pendingDeleteLower := strings.ToLower(pendingDelete) + if pendingDeleteLower == "all" || pendingDeleteLower == "any" { + extra.Set("pending_deleted", jsonutils.NewBool(model.PendingDeleted)) + } + } return extra }