Skip to content

Commit

Permalink
fix: exit with err when no-op cause of unreachable
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco98 committed Jul 27, 2024
1 parent bcaf020 commit 4083d80
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ var (
commit = "none"
date = "unknown"
errPendingUpdatesRefused = errors.New("pending updates forced with no")
errRouterUnreachable = errors.New("one or more routers unreachable")
)

type RosParams struct {
Expand Down Expand Up @@ -107,6 +108,11 @@ func run() error {
pkgupdrts, fwupdrts := planUpgrades(rts, *tver, *branch, *noupdfw)
if len(pkgupdrts) == 0 && len(fwupdrts) == 0 {
log.Println("no action required - exiting")
for _, v := range rts {
if v.Conn == nil {
return errRouterUnreachable
}
}
return nil
}
if *forceno {
Expand Down

0 comments on commit 4083d80

Please sign in to comment.