script: PY3 port traffic_learner
authorNoel Power <noel.power@suse.com>
Mon, 19 Nov 2018 10:49:40 +0000 (10:49 +0000)
committerNoel Power <npower@samba.org>
Mon, 10 Dec 2018 09:38:23 +0000 (10:38 +0100)
Use python3 compatable print

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
script/traffic_learner

index fd5affd609b14bebf36f673ee74202fcf9a7c86a..1abfdf7b37b6cb77a260a8aceefa684b42e96047 100755 (executable)
@@ -16,7 +16,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
-
+from __future__ import print_function
 import sys
 import argparse
 
@@ -37,12 +37,12 @@ def main():
     args = parser.parse_args()
 
     if not args.out:
-        print >> sys.stdout, "No output file was specified to write the model to."
-        print >> sys.stdout, "Please specify a filename using the --out option."
+        print("No output file was specified to write the model to.", file=sys.stdout)
+        print("Please specify a filename using the --out option.", file=sys.stdout)
         return
 
     if args.SUMMARY_FILE is sys.stdin:
-        print >> sys.stderr, "reading from STDIN..."
+        print("reading from STDIN...", file=sys.stderr)
 
     (conversations,
      interval,
@@ -51,7 +51,7 @@ def main():
                                             dns_mode=args.dns_mode)
 
     model = traffic.TrafficModel()
-    print >> sys.stderr, "learning model"
+    print("learning model", sys.stderr)
     if args.dns_mode == 'count':
         model.learn(conversations, dns_counts)
     else: