Skip to content

Commit 3f5af11

Browse files
committed
numalign: crash on error
let's bail out with error if the resources are not aligned Signed-off-by: Francesco Romani <fromani@redhat.com>
1 parent f6b6f63 commit 3f5af11

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

cmd/numalign/main.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ func main() {
3535
var sleepHoursParam = flag.StringP("sleep-hours", "S", "", "sleep hours once done.")
3636
var scriptPathParam = flag.StringP("script-path", "P", "", "save test script to this path.")
3737
var jsonOutput = flag.BoolP("json", "J", false, "output in JSON")
38+
var sleepOnError = flag.BoolP("sleep-on-error", "E", false, "still sleep if failed before to exit")
3839
flag.Parse()
3940

4041
if _, ok := os.LookupEnv("NUMALIGN_DEBUG"); !ok {
@@ -89,6 +90,8 @@ func main() {
8990
}
9091
}
9192

92-
time.Sleep(sleepTime)
93+
if rc == 0 || *sleepOnError {
94+
time.Sleep(sleepTime)
95+
}
9396
os.Exit(rc)
9497
}

0 commit comments

Comments
 (0)