]> git.proxmox.com Git - mirror_ovs.git/commitdiff
utilities: Make ovs-pipegen.py Python 3 friendly
authorTimothy Redaelli <tredaelli@redhat.com>
Tue, 13 Mar 2018 16:48:23 +0000 (17:48 +0100)
committerRussell Bryant <russell@ovn.org>
Tue, 13 Mar 2018 19:53:56 +0000 (15:53 -0400)
Replace "print f" with "print(f)" and "xrange" with "range".

The changes are backward compatibile with Python 2.

Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
Signed-off-by: Russell Bryant <russell@ovn.org>
utilities/ovs-pipegen.py

index 4bf240f3a0a9575449d26ef6139fe064d7334841..f040a7e1b3da3973b5157ec47f56bfb64e8f0e00 100755 (executable)
@@ -71,15 +71,15 @@ def pipeline(size):
     pipeline = [l2, l3, l4, l2]
 
     flows = []
-    for stage in xrange(len(pipeline)):
+    for stage in range(len(pipeline)):
         action = resubmit(stage + 1)
-        flows += [pipeline[stage](stage, action) for _ in xrange(size)]
+        flows += [pipeline[stage](stage, action) for _ in range(size)]
         flows.append(flow_str(stage, "", action, priority=1))
 
     flows.append(flow_str(len(pipeline), "", "in_port"))
 
     for f in flows:
-        print f
+        print(f)
 
 
 def main():