From f3983e2204c7dd474958e4b8cf2a349288f51657 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sat, 21 May 2016 23:35:02 -0400 Subject: countdown: only run when interactive There's no point in sleeping when running from scripted sessions. --- catalyst/support.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/catalyst/support.py b/catalyst/support.py index f2ae5bb6..60cdaf62 100644 --- a/catalyst/support.py +++ b/catalyst/support.py @@ -219,6 +219,10 @@ def addl_arg_parse(myspec,addlargs,requiredspec,validspec): def countdown(secs=5, doing="Starting"): + # If this is non-interactive (e.g. a cronjob), then sleeping is pointless. + if not os.isatty(sys.stdin.fileno()): + return + if secs: sys.stdout.write( ('>>> Waiting %s seconds before starting...\n' -- cgit v1.2.3-18-g5258