[WIP] ONOS-8091 Port python script and utilities to python3
Steps performed so far:
- Updated bash scripts and similar to explicitly invoke python3 (instead of python)
- Updated all python scripts using 2to3
Testing these changes will be a major headache because:
- different scripts are executed in different environments
(e.g., Jenkins, cell servers, tutorial VMs, etc.)
- we don’t have control on all environments
- some environments we used to control have been dismissed
(e.g., cell servers)
The approach for now is to focus on the essentials:
- Jenkins jobs for pre-merge and release
Test and fix everything else as the need arises.
Change-Id: I943e214760c9dea9a7ded0d47ef08adbc0ed0bec
diff --git a/tools/test/topos/sdnip.py b/tools/test/topos/sdnip.py
index 7739d58..b561111 100755
--- a/tools/test/topos/sdnip.py
+++ b/tools/test/topos/sdnip.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
from mininet.cli import CLI
from mininet.log import setLogLevel
@@ -65,26 +65,26 @@
numRoutesPerAs = 32
# Add external ASes
- as1 = BasicAutonomousSystem(1, generateRoutes(u'192.168.1.0/24', numRoutesPerAs))
+ as1 = BasicAutonomousSystem(1, generateRoutes('192.168.1.0/24', numRoutesPerAs))
AutonomousSystem.addPeering(as1, sdnAs)
AutonomousSystem.addPeering(as1, sdnAs, router2=3, intf1=2)
as1.addLink(s5)
as1.addLink(s6)
as1.build(self)
- as2 = BasicAutonomousSystem(2, generateRoutes(u'192.168.2.0/24', numRoutesPerAs))
+ as2 = BasicAutonomousSystem(2, generateRoutes('192.168.2.0/24', numRoutesPerAs))
AutonomousSystem.addPeering(as2, sdnAs)
AutonomousSystem.addPeering(as2, sdnAs, router2=2)
as2.addLink(s7)
as2.build(self)
- as3 = BasicAutonomousSystem(3, generateRoutes(u'192.168.3.0/24', numRoutesPerAs))
+ as3 = BasicAutonomousSystem(3, generateRoutes('192.168.3.0/24', numRoutesPerAs))
AutonomousSystem.addPeering(as3, sdnAs, router2=2)
AutonomousSystem.addPeering(as3, sdnAs, router2=3)
as3.addLink(s8)
as3.build(self)
- as4 = BasicAutonomousSystem(4, generateRoutes(u'192.168.4.0/24', numRoutesPerAs), numRouters=2)
+ as4 = BasicAutonomousSystem(4, generateRoutes('192.168.4.0/24', numRoutesPerAs), numRouters=2)
AutonomousSystem.addPeering(as4, sdnAs)
AutonomousSystem.addPeering(as4, sdnAs, router1=2, router2=3)
as4.addLink(s9)