Skip to content

Commit c4f6c75

Browse files
matzfjuagargi
authored andcommitted
Replace python2 with python3 in health-check scripts
Avoids dependency on python2 (which is not currently installed in VMs).
1 parent 8920e6f commit c4f6c75

File tree

4 files changed

+8
-9
lines changed

4 files changed

+8
-9
lines changed

webapp/dependencies.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,13 @@ webapp \
3939
- curl
4040
- set
4141
- grep
42-
- python
42+
- python3
4343
- df
4444
- tr
4545
- free
4646
- sleep
4747
- cat
4848
- systemctl
49-
- python2
5049

5150
## SCION Binaries Used/Checked
5251
- $sbin/scmp

webapp/web/tests/health/netcheck.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ as=$(echo ${iaFile} | cut -d"-" -f2)
1010
topologyFile=$SCION_GEN/ISD$isd/AS$as/endhost/topology.json
1111

1212
# get remote addresses from interfaces
13-
ip_dsts=$(cat $topologyFile | python2 -c "import sys, json
13+
ip_dsts=$(cat $topologyFile | python3 -c "import sys, json
1414
brs = json.load(sys.stdin)['BorderRouters']
1515
for b in brs:
1616
for i in brs[b]['Interfaces']:
17-
print brs[b]['Interfaces'][i]['RemoteOverlay']['Addr']")
17+
print(brs[b]['Interfaces'][i]['RemoteOverlay']['Addr'])")
1818

1919
# test icmp ping on each interface
2020
for ip_dst in $ip_dsts

webapp/web/tests/health/scmpcheck.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ as=$(echo ${iaFile} | cut -d"-" -f2)
1515
topologyFile=$SCION_GEN/ISD$isd/AS$as/endhost/topology.json
1616

1717
# get remote addresses from interfaces, return paired list
18-
dsts=($(cat $topologyFile | python2 -c "import sys, json
18+
dsts=($(cat $topologyFile | python3 -c "import sys, json
1919
brs = json.load(sys.stdin)['BorderRouters']
2020
for b in brs:
2121
for i in brs[b]['Interfaces']:
22-
print brs[b]['Interfaces'][i]['ISD_AS']
23-
print brs[b]['Interfaces'][i]['RemoteOverlay']['Addr']"))
22+
print(brs[b]['Interfaces'][i]['ISD_AS'])
23+
print(brs[b]['Interfaces'][i]['RemoteOverlay']['Addr'])"))
2424

2525
# test scmp echo on each interface
2626
for ((i=0; i<${#dsts[@]}; i+=2))

webapp/web/tests/health/testVPN.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ fi
2828
ipAddress=$(echo "$targetLines" | grep -oE "\b([0-9]{1,3}\.){3}[0-9]{1,3}\b" | head -n1)
2929
topologyFile=$SCION_GEN/ISD*/AS*/endhost/topology.json
3030
# ip address specified in the topology file. If "bind" parameter present, use that one; "public" if not
31-
ipTopology=$(cat $topologyFile | python2 -c "import sys, json
31+
ipTopology=$(cat $topologyFile | python3 -c "import sys, json
3232
brs = json.load(sys.stdin)['BorderRouters']
3333
interfaces=next(iter(brs.values()))['Interfaces']
3434
inter=next(iter(interfaces.values()))
35-
print inter['BindOverlay'] if 'BindOverlay' in inter.keys() else inter['PublicOverlay']['Addr']")
35+
print(inter['BindOverlay'] if 'BindOverlay' in inter.keys() else inter['PublicOverlay']['Addr'])")
3636

3737
# 2.check if the ip address from the tun0 interface is consistent with the one from the topology.
3838
if [[ $ipAddress != $ipTopology ]]; then

0 commit comments

Comments
 (0)