From: Peter van Dijk Date: Sat, 1 Sep 2018 21:15:46 +0000 (+0200) Subject: make negcache-tests-dotted-cname test portable between Python versions X-Git-Tag: dnsdist-1.3.3~123^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=effe75729e5af211a8846fe71c8953d7eedefd96;p=thirdparty%2Fpdns.git make negcache-tests-dotted-cname test portable between Python versions --- diff --git a/regression-tests.nobackend/negcache-tests-dotted-cname/pipe.py b/regression-tests.nobackend/negcache-tests-dotted-cname/pipe.py index 19222395c4..0d4e52d78e 100755 --- a/regression-tests.nobackend/negcache-tests-dotted-cname/pipe.py +++ b/regression-tests.nobackend/negcache-tests-dotted-cname/pipe.py @@ -1,32 +1,32 @@ -#!/usr/bin/python2 -u +#!/usr/bin/env python2.7 -u import sys line = sys.stdin.readline() # TOLO -print 'OK\tTest backend firing up' +print('OK\tTest backend firing up') while True: line = sys.stdin.readline() items = line.split('\t') sys.stderr.write(line) if len(items) < 6: - print 'LOG\tGot an unparseable line' - print 'LOG\t%s' % line - print 'END' + print('LOG\tGot an unparseable line') + print('LOG\t%s' % line) + print('END') continue what, qname, qclass, qtype, id, ip = items if qtype in ['SOA', 'ANY'] and qname == 'example2.com': - print 'DATA\t%s\t%s\tSOA\t300\t-1\tns1.example.com ahu.example.com 2008080300 1800 3600 604800 3600' % (qname, qclass) + print('DATA\t%s\t%s\tSOA\t300\t-1\tns1.example.com ahu.example.com 2008080300 1800 3600 604800 3600' % (qname, qclass)) if qtype in ['NS', 'ANY'] and qname == 'example2.com': - print 'DATA\t%s\t%s\tNS\t3600\t-1\tns1.example.com' % (qname, qclass) - print 'DATA\t%s\t%s\tNS\t3600\t-1\tns2.example.com' % (qname, qclass) + print('DATA\t%s\t%s\tNS\t3600\t-1\tns1.example.com' % (qname, qclass)) + print('DATA\t%s\t%s\tNS\t3600\t-1\tns2.example.com' % (qname, qclass)) if qtype in ['A', 'ANY'] and qname.endswith('example2.com'): # We were asked a specific record - print 'DATA\t%s\t%s\tCNAME\t3600\t-1\twww.example.com.' % (qname, qclass) + print('DATA\t%s\t%s\tCNAME\t3600\t-1\twww.example.com.' % (qname, qclass)) - print 'END' + print('END')