Fix all-nodes.sh for python3

The unicode function no longer exists in python3 so let's just designate
the string as unicode since we're doing replacement in bash anyway.

Change-Id: I3226a3a16eec711097c30929946cb2d36646c4cc
Related-Blueprint: python3-support
This commit is contained in:
Alex Schultz 2018-08-27 16:38:38 -06:00
parent c7aeb8f7c8
commit aa1b108760
1 changed files with 1 additions and 1 deletions

View File

@ -33,7 +33,7 @@ function ping_controller_ips() {
networks=$(ip r | grep -v default | cut -d " " -f 1)
fi
for LOCAL_NETWORK in $networks; do
in_network=$(python -c "import ipaddress; net=ipaddress.ip_network(unicode('$LOCAL_NETWORK')); addr=ipaddress.ip_address(unicode('$REMOTE_IP')); print(addr in net)")
in_network=$(python -c "import ipaddress; net=ipaddress.ip_network(u'$LOCAL_NETWORK'); addr=ipaddress.ip_address(u'$REMOTE_IP'); print(addr in net)")
if [[ $in_network == "True" ]]; then
echo "Trying to ping $REMOTE_IP for local network ${LOCAL_NETWORK}."
set +e