Skip to content

Commit

Permalink
fix the tag filter and result record for scheduledtask
Browse files Browse the repository at this point in the history
  • Loading branch information
rainzm committed Jun 10, 2020
1 parent 2f210ae commit 5f2a91f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions pkg/compute/models/scheduled_tasks.go
Expand Up @@ -457,7 +457,7 @@ func (st *SScheduledTask) Execute(ctx context.Context, userCred mcclient.TokenCr
Scope: "system",
Tags: labels,
}
res, err := action.List(&opts)
res, err := action.List(&WrapperListOptions{opts})
if err != nil {
return err
}
Expand All @@ -480,7 +480,7 @@ func (st *SScheduledTask) Execute(ctx context.Context, userCred mcclient.TokenCr
workerQueue <- struct{}{}
go func(n int, id string) {
ok, reason := action.Apply(id)
results[i] = result{id, ok, reason}
results[n] = result{id, ok, reason}
<-workerQueue
}(i, id)
}
Expand Down Expand Up @@ -701,7 +701,11 @@ func (r SAction) DefaultParams(dict *jsonutils.JSONDict) SAction {
return r
}

func (r SAction) List(opts *options.BaseListOptions) (map[string]string, error) {
type WrapperListOptions struct {
options.BaseListOptions
}

func (r SAction) List(opts *WrapperListOptions) (map[string]string, error) {
resourceManager, ok := Modules[r.operation.Resource]
if !ok {
return nil, errors.Errorf("no such resource '%s' in Modules", r.operation.Resource)
Expand Down

0 comments on commit 5f2a91f

Please sign in to comment.