Skip to content

Commit

Permalink
mcclient: options: remove implied details=true for pending_delete=all
Browse files Browse the repository at this point in the history
  • Loading branch information
yousong committed May 21, 2020
1 parent 899c31d commit 9a47116
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
1 change: 0 additions & 1 deletion pkg/mcclient/options/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,6 @@ func (opts *BaseListOptions) Params() (*jsonutils.JSONDict, error) {
}
if BoolV(opts.PendingDeleteAll) {
params.Set("pending_delete", jsonutils.NewString("all"))
params.Set("details", jsonutils.JSONTrue) // required to get pending_deleted field
}
/*if opts.Admin == nil {
requiresSystem := len(opts.Tenant) > 0 ||
Expand Down
7 changes: 2 additions & 5 deletions pkg/mcclient/options/base_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -247,11 +247,8 @@ func TestBaseListOptions(t *testing.T) {
}
for _, f := range []string{"details"} {
got, err := params.Bool(f)
if err != nil {
t.Fatalf("getting %s field failed: %s", f, err)
}
if !got {
t.Errorf("expecting %s=true, got false", f)
if got {
t.Fatalf("pending_delete=all should not imply details=true: %v", err)
}
}
})
Expand Down

0 comments on commit 9a47116

Please sign in to comment.