Implement majority of provisioning changes

Signed-off-by: Simon Thulborn <simon+github@thulborn.com>
Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
This commit is contained in:
Nathan LeClaire and Simon Thulborn
2015-02-16 23:16:36 +00:00
committed by Nathan LeClaire
parent 8d5a59b43e
commit 49feb33457
16 changed files with 1096 additions and 580 deletions

View File

@@ -4,6 +4,7 @@ import (
"encoding/json"
"fmt"
"io"
"net"
"os"
"path/filepath"
"runtime"
@@ -95,6 +96,18 @@ func WaitFor(f func() bool) error {
return WaitForSpecific(f, 60, 3*time.Second)
}
func WaitForDocker(ip string, daemonPort int) error {
return WaitFor(func() bool {
conn, err := net.Dial("tcp", fmt.Sprintf("%s:%d", ip, daemonPort))
if err != nil {
fmt.Println("Got an error it was", err)
return false
}
conn.Close()
return true
})
}
func DumpVal(vals ...interface{}) {
for _, val := range vals {
prettyJSON, err := json.MarshalIndent(val, "", " ")