Skip to content

Commit

Permalink
vcsim: ModifyListView 'remove' does not return unresolved objects
Browse files Browse the repository at this point in the history
From the sdk doc ModifyListView Return Value:
> A list containing any objects in 'add' that could not be resolved
  • Loading branch information
dougm committed Oct 4, 2024
1 parent d1684ba commit fc91180
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
3 changes: 0 additions & 3 deletions simulator/view_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -275,9 +275,6 @@ func (v *ListView) ModifyListView(ctx *Context, req *types.ModifyListView) soap.

for _, ref := range req.Remove {
RemoveReference(&v.View, ref)
if ctx.Map.Get(ref) == nil {
body.Res.Returnval = append(body.Res.Returnval, ref)
}
}

if len(req.Remove) != 0 || len(req.Add) != 0 {
Expand Down
9 changes: 9 additions & 0 deletions simulator/view_manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,5 +222,14 @@ func TestListViewModify(t *testing.T) {
if len(refs) != 1 {
t.Errorf("unresolved refs=%s", refs)
}

refs, err = list.Remove(ctx, add)
if err != nil {
log.Fatal(err)
}

if len(refs) != 0 {
t.Errorf("unresolved refs=%s", refs)
}
})
}

0 comments on commit fc91180

Please sign in to comment.