Skip to content

Commit

Permalink
Fix Json body on Sandoxe Put, so chef server accept the PUT
Browse files Browse the repository at this point in the history
  • Loading branch information
Pascal Laporte authored and Pascal Laporte committed Aug 17, 2015
1 parent 98983e8 commit dd6d3c0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions sandbox.go
Expand Up @@ -2,7 +2,6 @@ package chef

import (
"fmt"
"strings"
"time"
)

Expand Down Expand Up @@ -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.")
Expand Down

0 comments on commit dd6d3c0

Please sign in to comment.