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

fleetctl: print error when units were not found in registry #1503

Merged
merged 1 commit into from
Jul 8, 2016
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
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