Skip to content

Commit

Permalink
Fixed CLI commands usage
Browse files Browse the repository at this point in the history
  • Loading branch information
shlomi-noach committed Nov 11, 2015
1 parent 331f437 commit ba065de
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 22 deletions.
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#
set -e

RELEASE_VERSION="1.4.499"
RELEASE_VERSION="1.4.500"
TOPDIR=/tmp/orchestrator-release
export RELEASE_VERSION TOPDIR

Expand Down
39 changes: 18 additions & 21 deletions go/app/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,31 +142,17 @@ func Cli(command string, strict bool, instance string, destination string, owner
}
inst.SetMaintenanceOwner(owner)

preDatabaseCommandHandled := true
skipDatabaseCommands := false
switch command {
case "reset-internal-db-deployment": //, "Meta, internal", `Clear internal db deployment history, use if somehow corrupted internal deployment history`):
{
config.Config.SkipOrchestratorDatabaseUpdate = true
db.ResetInternalDeployment()
fmt.Println("Internal db deployment history reset. Next orchestrator execution will rebuild internal db structure (no data will be lost)")
}
// Help
case "reset-internal-db-deployment":
skipDatabaseCommands = true
case "help":
{
fmt.Fprintf(os.Stderr, availableCommandsUsage())
}
default:
{
preDatabaseCommandHandled = false
}
}
if preDatabaseCommandHandled {
// We're done
os.Exit(0)
skipDatabaseCommands = true
}

process.ContinuousRegistration(string(process.OrchestratorExecutionCliMode), command)

if !skipDatabaseCommands {
process.ContinuousRegistration(string(process.OrchestratorExecutionCliMode), command)
}
// begin commands
switch command {
// smart mode
Expand Down Expand Up @@ -1281,6 +1267,17 @@ func Cli(command string, strict bool, instance string, destination string, owner
}
fmt.Println("hostname resolve cache cleared")
}
case registerCliCommand("reset-internal-db-deployment", "Meta, internal", `Clear internal db deployment history, use if somehow corrupted internal deployment history`):
{
config.Config.SkipOrchestratorDatabaseUpdate = true
db.ResetInternalDeployment()
fmt.Println("Internal db deployment history reset. Next orchestrator execution will rebuild internal db structure (no data will be lost)")
}
// Help
case "help":
{
fmt.Fprintf(os.Stderr, availableCommandsUsage())
}
default:
log.Fatalf("Unknown command: \"%s\". %s", command, availableCommandsUsage())
}
Expand Down

0 comments on commit ba065de

Please # to comment.