From: Alexander Gozman Date: Thu, 18 Jun 2015 17:44:26 +0000 (+0300) Subject: In non interactive mode, print errors to stderr X-Git-Tag: suricata-3.0RC1~272 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e0289179557117897245510e4b119a66f97db2fb;p=thirdparty%2Fsuricata.git In non interactive mode, print errors to stderr --- diff --git a/scripts/suricatasc/suricatasc.in b/scripts/suricatasc/suricatasc.in index 6c33ba3237..63b4ebfaf5 100755 --- a/scripts/suricatasc/suricatasc.in +++ b/scripts/suricatasc/suricatasc.in @@ -15,6 +15,8 @@ # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +from __future__ import print_function +import sys import argparse from suricatasc import * @@ -33,10 +35,10 @@ sc = SuricataSC(SOCKET_PATH, verbose=args.verbose) try: sc.connect() except SuricataNetException as err: - print("Unable to connect to socket %s: %s" % (SOCKET_PATH, err)) + print("Unable to connect to socket %s: %s" % (SOCKET_PATH, err), file=sys.stderr) sys.exit(1) except SuricataReturnException as err: - print("Unable to negotiate version with server: %s" % (err)) + print("Unable to negotiate version with server: %s" % (err), file=sys.stderr) sys.exit(1) if args.command: