Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Commit

Permalink
fleetctl: print error message when units were not found in registry
Browse files Browse the repository at this point in the history
  • Loading branch information
kayrus committed Mar 14, 2016
1 parent 8e1dd44 commit ffe3981
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions fleetctl/destroy.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ func runDestroyUnits(args []string) (exit int) {
return 1
}

if (len(units) == 0) {
stderr("Units not found in registry")
return 0
}

for _, v := range units {
err := cAPI.DestroyUnit(v.Name)
if err != nil {
Expand Down
5 changes: 5 additions & 0 deletions fleetctl/stop.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ func runStopUnit(args []string) (exit int) {
return 1
}

if (len(units) == 0) {
stderr("Units not found in registry")
return 0
}

stopping := make([]string, 0)
for _, u := range units {
if !suToGlobal(u) {
Expand Down
5 changes: 5 additions & 0 deletions fleetctl/unload.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ func runUnloadUnit(args []string) (exit int) {
return 1
}

if (len(units) == 0) {
stderr("Units not found in registry")
return 0
}

wait := make([]string, 0)
for _, s := range units {
if !suToGlobal(s) {
Expand Down

0 comments on commit ffe3981

Please sign in to comment.