diff --git a/Makefile b/Makefile index ca14f57..129cd5f 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ BINARY=salt-bootstrap -VERSION=0.2.0 +VERSION=0.2.1 BUILD_TIME=$(shell date +%FT%T) LDFLAGS=-ldflags "-X github.com/sequenceiq/salt-bootstrap/saltboot.Version=${VERSION} -X github.com/sequenceiq/salt-bootstrap/saltboot.BuildTime=${BUILD_TIME}" diff --git a/saltboot/salt_test.go b/saltboot/salt_test.go deleted file mode 100644 index 9c5a046..0000000 --- a/saltboot/salt_test.go +++ /dev/null @@ -1,15 +0,0 @@ -package saltboot - -import "testing" - -func TestString(t *testing.T) { - ar := SaltActionRequest{ - Server: "10.0.0.0", - Action: "start", - } - - expected := "{\"server\":\"10.0.0.0\",\"action\":\"start\"}" - if ar.String() != expected { - t.Errorf("SaltActionRequest.String() %s == %s", expected, ar.String()) - } -} diff --git a/saltboot/user.go b/saltboot/user.go index f429d1e..98c75b2 100644 --- a/saltboot/user.go +++ b/saltboot/user.go @@ -44,15 +44,11 @@ func CreateUser(saltMaster SaltMaster) (resp model.Response, err error) { if err != nil { return model.Response{ErrorText: err.Error(), StatusCode: http.StatusInternalServerError}, err } - result, err = ExecCmd("adduser", "--password", hash, SALT_USER) + result, err = ExecCmd("adduser", "-G", "wheel", "-s", "/bin/false", "--password", hash, SALT_USER) if err != nil { return model.Response{ErrorText: err.Error(), StatusCode: http.StatusInternalServerError}, err } - result, err = ExecCmd("usermod", "-G", "wheel", SALT_USER) - if err != nil { - return model.Response{ErrorText: err.Error(), StatusCode: http.StatusInternalServerError}, err - } } else { log.Printf("[CreateUser] user: %s exsist", SALT_USER) }