diff --git a/govc/task/create.go b/govc/task/create.go index 7ddd0ca1d..9e856187c 100644 --- a/govc/task/create.go +++ b/govc/task/create.go @@ -94,7 +94,7 @@ func (cmd *create) Run(ctx context.Context, f *flag.FlagSet) error { return err } - fmt.Println(res.Returnval.Task) + fmt.Println(res.Returnval.Task.Value) return nil } diff --git a/govc/test/tasks.bats b/govc/test/tasks.bats index ade1ccbfe..7d98bae53 100755 --- a/govc/test/tasks.bats +++ b/govc/test/tasks.bats @@ -56,6 +56,15 @@ load test_helper assert_success task="$output" + run govc task.cancel "$task" + assert_success + cancelled=$(govc tasks -json | jq ".tasks[] | select(.key == \"$task\") | .cancelled") + assert_equal "true" "$cancelled" + + run govc task.create "$id" + assert_success + task="$output" + run govc task.set -s running "$task" assert_success diff --git a/simulator/task.go b/simulator/task.go index cab4eaf64..a08b0900e 100644 --- a/simulator/task.go +++ b/simulator/task.go @@ -257,7 +257,7 @@ func (t *Task) CancelTask(ctx *Context, req *types.CancelTask) soap.HasFault { } changes := []types.PropertyChange{ - {Name: "info.canceled", Val: true}, + {Name: "info.cancelled", Val: true}, {Name: "info.completeTime", Val: time.Now()}, {Name: "info.state", Val: types.TaskInfoStateError}, {Name: "info.error", Val: &types.LocalizedMethodFault{