]> granicus.if.org Git - pdns/commitdiff
make negcache-tests-dotted-cname test portable between Python versions
authorPeter van Dijk <peter.van.dijk@powerdns.com>
Sat, 1 Sep 2018 21:15:46 +0000 (23:15 +0200)
committerPeter van Dijk <peter.van.dijk@powerdns.com>
Sat, 1 Sep 2018 21:15:46 +0000 (23:15 +0200)
regression-tests.nobackend/negcache-tests-dotted-cname/pipe.py

index 19222395c495bc8e314a60e59d136e2fd98a46fb..0d4e52d78e4bdb11b91c0e52c3f74f6a0a944a6c 100755 (executable)
@@ -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')