Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Enhance command output #601

Merged
merged 1 commit into from
Oct 18, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion commands/dns/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ func addFn(ccmd *cobra.Command, args []string) {
app.Generate(env, name)
display.CommandErr(app_dns.Add(env, app, args[0]))
case "production":
fmt.Println("not yet implemented")
fmt.Printf(`
--------------------------------------------------------
Production dns aliasing is not yet implemented.
--------------------------------------------------------
`)
}
}
7 changes: 6 additions & 1 deletion commands/dns/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ func listFn(ccmd *cobra.Command, args []string) {
app, _ := models.FindAppBySlug(config.EnvID(), name)
display.CommandErr(app_dns.List(app))
case "production":
fmt.Println("not yet implemented")
fmt.Printf(`
--------------------------------------------------------
Production dns aliasing is not yet implemented.
--------------------------------------------------------
`)
}
}
7 changes: 6 additions & 1 deletion commands/dns/remove.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ func removeFn(ccmd *cobra.Command, args []string) {
app, _ := models.FindAppBySlug(config.EnvID(), name)
display.CommandErr(app_dns.Remove(app, args[0]))
case "production":
fmt.Println("not yet implemented")
fmt.Printf(`
--------------------------------------------------------
Production dns aliasing is not yet implemented.
--------------------------------------------------------
`)
}
}
7 changes: 6 additions & 1 deletion commands/dns/remove_all.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ func removeAllFn(ccmd *cobra.Command, args []string) {
app, _ := models.FindAppBySlug(config.EnvID(), name)
display.CommandErr(app_dns.RemoveAll(app))
case "production":
fmt.Println("not yet implemented")
fmt.Printf(`
--------------------------------------------------------
Production dns aliasing is not yet implemented.
--------------------------------------------------------
`)
}
}
7 changes: 6 additions & 1 deletion commands/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ func infoFn(ccmd *cobra.Command, args []string) {
appModel, _ := models.FindAppBySlug(config.EnvID(), name)
display.CommandErr(app.Info(env, appModel))
case "production":
fmt.Println("not yet implemented")
fmt.Printf(`
----------------------------------------------------------
Showing production app information is not yet implemneted.
----------------------------------------------------------
`)
}
}
6 changes: 3 additions & 3 deletions commands/#.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ var (
LoginCmd = &cobra.Command{
Use: "login",
Short: "Authenticate your nanobox client with your nanobox.io account.",
Long: `
Long: `
Authenticate with your nanobox account by passing the username and password in or using the following environment variables:
NANOBOX_USERNAME
NANOBOX_PASSWORD
`,
Run: loginFn,
`,
Run: loginFn,
}

// loginCmdFlags ...
Expand Down
2 changes: 1 addition & 1 deletion commands/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const name = "nanobox-server"
func serverFnc(ccmd *cobra.Command, args []string) {

if !util.IsPrivileged() {
log.Fatal("server needs to run as privilaged user")
log.Fatal("server needs to run as a privileged user")
return
}
// make sure things know im the server
Expand Down
13 changes: 12 additions & 1 deletion processors/configure_set.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package processors

import (
"fmt"
"strconv"

"github.com/nanobox-io/nanobox/models"
Expand Down Expand Up @@ -40,7 +41,17 @@ func ConfigureSet(key, val string) error {
config.CISyncVerbose = val == "true" || val == "t" || val == "1"
case "anonymous":
config.Anonymous = val == "true" || val == "t" || val == "1"
default:
fmt.Printf("'%s' is not a valid key.\n", key)
return nil
}

return config.Save()
err := config.Save()
if err == nil {
fmt.Printf("Successfully set '%s'\n", key)
} else {
fmt.Printf("Failed to set '%s'\n", key)
}

return err
}
2 changes: 1 addition & 1 deletion processors/provider/bridge/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func setupContainer() error {
container, err := docker.CreateContainer(config)
if err != nil {
display.ErrorTask()
return util.ErrorAppend(err, "failed to create docker container")
return util.ErrorAppend(err, "failed to create bridge container")
}
display.StopTask()

Expand Down
1 change: 1 addition & 0 deletions processors/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ func watchFiles(envModel *models.Env, appModel *models.App) {
boxfile := boxfile.New([]byte(appModel.DeployedBoxfile))
if boxfile.Node("run.config").BoolValue("fs_watch") && (provider.RequiresMount() || specialException()) {
lumber.Info("watcher starting")
// todo: server.Watch to call the following, so we can pre-emptively set ulimit to much higher.
go watch.Watch(container_generator.DevName(), envModel.Directory)
}
}
Expand Down
16 changes: 12 additions & 4 deletions util/provider/dockermachine.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,19 @@ func (machine DockerMachine) Valid() (error, []string) {
case "linux":
out, err := exec.Command("netstat", "-tln").CombinedOutput()
if err != nil {
missingParts = append(missingParts, "netfs")
masterErr = fmt.Errorf("%s - failed to check for netfs - %q", masterErr.Error(), err.Error())
missingParts = append(missingParts, "nfs-kernel-server")
if masterErr == nil {
masterErr = fmt.Errorf("failed to check for netfs - %s", err.Error())
} else {
masterErr = fmt.Errorf("%s - failed to check for netfs - %s", masterErr.Error(), err.Error())
}
} else if !bytes.Contains(out, []byte("2049")) {
missingParts = append(missingParts, "netfs")
masterErr = fmt.Errorf("%s - missing or not running netfs - %q", masterErr.Error(), err.Error())
missingParts = append(missingParts, "nfs-kernel-server")
if masterErr == nil {
masterErr = fmt.Errorf("missing or not running netfs")
} else {
masterErr = fmt.Errorf("%s - missing or not running netfs", masterErr.Error())
}
}

if err := exec.Command("exportfs").Run(); err != nil {
Expand Down