cloudcommon: virtualresource: show pending_deleted field when queried

This commit is contained in:
Yousong Zhou
2018-09-13 02:06:41 +00:00
parent 2ff04e3d97
commit c66e264aff
+8
View File
@@ -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
}