From 803bbef6c62f34e1a55bcd72bf6356a7927f69e1 Mon Sep 17 00:00:00 2001 From: Hidden Z Date: Sun, 17 Oct 2010 18:45:16 +0000 Subject: [PATCH] injector: output errors to stderr --- injector | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/injector b/injector index dfc0845..d908693 100755 --- a/injector +++ b/injector @@ -28,7 +28,7 @@ for line in f: if line.startswith('#') or line.isspace(): continue if line.find('=') == -1: - print 'Invalid line: %s' % line + sys.stderr.write('Invalid line: %s\n' % line) continue # strip trailing '\n' line = line.rstrip('\n') @@ -37,7 +37,7 @@ for line in f: hostname = validate_hostname(entry[0]) base64 = validate_b64hash(entry[1], check_uniq=False) # don't require uniqueness except ValidationError, e: - print 'validation error: %s: %s' % (e, line) + sys.stderr.write('validation error: %s: %s\n' % (e, line)) else: # Check for already existed hosts in database to avoid unneeded INSERTs # beacuse they will fail anyway.