From dd6d3c07c55d94b7441572e230ab5d92e7d8c30d Mon Sep 17 00:00:00 2001 From: Pascal Laporte Date: Mon, 17 Aug 2015 16:00:23 -0400 Subject: [PATCH] Fix Json body on Sandoxe Put, so chef server accept the PUT --- sandbox.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sandbox.go b/sandbox.go index 57cf297..43d48ec 100644 --- a/sandbox.go +++ b/sandbox.go @@ -2,7 +2,6 @@ package chef import ( "fmt" - "strings" "time" ) @@ -58,7 +57,9 @@ func (s SandboxService) Post(sums []string) (data SandboxPostResponse, err error // Put is used to commit a sandbox ID to the chef server. To singal that the sandox you have Posted is now uploaded. func (s SandboxService) Put(id string) (box Sandbox, err error) { - body := strings.NewReader(`{"is_completed":true}"}`) + answer := make(map[string]bool) + answer["is_completed"] = true + body, err := JSONReader(answer) if id == "" { return box, fmt.Errorf("must supply sandbox id to PUT request.")