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

Commit

Permalink
Merge pull request #1503 from endocode/kayrus/units_not_found
Browse files Browse the repository at this point in the history
fleetctl: print error when units were not found in registry
  • Loading branch information
Dongsu Park committed Jul 8, 2016
2 parents 40a90d0 + b445699 commit 54409ab
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 @@ -51,6 +51,11 @@ func runDestroyUnit(cCmd *cobra.Command, 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 @@ -66,6 +66,11 @@ func runStopUnit(cCmd *cobra.Command, 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 @@ -48,6 +48,11 @@ func runUnloadUnit(cCmd *cobra.Command, 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 54409ab

Please sign in to comment.