vpcagent: apihelper: do not set details=true by default

This commit is contained in:
Yousong Zhou
2020-05-13 14:14:48 +08:00
parent e8cbaee904
commit f33a2e1770
2 changed files with 10 additions and 8 deletions
+6 -5
View File
@@ -45,11 +45,12 @@ func SyncModelSets(mssOld IModelSets, s *mcclient.ClientSession, batchSize int)
for i, msNew := range mssNews.ModelSetList() {
minUpdatedAt := ModelSetMaxUpdatedAt(mss[i])
err = GetModels(&GetModelsOptions{
ClientSession: s,
ModelManager: msNew.ModelManager(),
MinUpdatedAt: minUpdatedAt,
ModelSet: msNew,
BatchListSize: batchSize,
ClientSession: s,
ModelManager: msNew.ModelManager(),
MinUpdatedAt: minUpdatedAt,
ModelSet: msNew,
BatchListSize: batchSize,
IncludeDetails: true,
})
if err != nil {
return
+4 -3
View File
@@ -38,8 +38,9 @@ type GetModelsOptions struct {
ModelManager mcclient_modulebase.IBaseManager
ModelSet IModelSet
BatchListSize int
MinUpdatedAt time.Time
BatchListSize int
MinUpdatedAt time.Time
IncludeDetails bool
}
func GetModels(opts *GetModelsOptions) error {
@@ -100,7 +101,7 @@ func GetModels(opts *GetModelsOptions) error {
listOptions := options.BaseListOptions{
Admin: options.Bool(true),
Details: options.Bool(true),
Details: options.Bool(opts.IncludeDetails),
Filter: []string{
minUpdatedAtFilter(minUpdatedAt), // order matters, filter.0
"manager_id.isnullorempty()", // len(manager_id) > 0 is for pubcloud objects