Browse Source

Use ipaddress module

This patch replaces use of ipaddr python module with
ipaddress module. The ipaddr has been superseded by the
ipaddress module.

Also install python-ipaddress instead of python-ipaddr in
deployed-server bootstrap scripts.

Closes-Bug: #1751934
Change-Id: I63ae89869c8994e17b3460f9ae94e5fa922f6237
changes/99/548099/2
Harald Jensas 4 years ago
parent
commit
d0a03972a6
  1. 2
      deployed-server/deployed-server-bootstrap-centos.sh
  2. 2
      deployed-server/deployed-server-bootstrap-rhel.sh
  3. 2
      validation-scripts/all-nodes.sh

2
deployed-server/deployed-server-bootstrap-centos.sh

@ -4,7 +4,7 @@ set -eux
yum install -y \
jq \
python-ipaddr \
python-ipaddress \
puppet-tripleo \
os-net-config \
openvswitch \

2
deployed-server/deployed-server-bootstrap-rhel.sh

@ -4,7 +4,7 @@ set -eux
yum install -y \
jq \
python-ipaddr \
python-ipaddress \
puppet-tripleo\
os-net-config \
openvswitch \

2
validation-scripts/all-nodes.sh

@ -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 ipaddr; net=ipaddr.IPNetwork('$LOCAL_NETWORK'); addr=ipaddr.IPAddress('$REMOTE_IP'); print(addr in net)")
in_network=$(python -c "import ipaddress; net=ipaddress.ip_network(unicode('$LOCAL_NETWORK')); addr=ipaddress.ip_address(unicode('$REMOTE_IP')); print(addr in net)")
if [[ $in_network == "True" ]]; then
echo "Trying to ping $REMOTE_IP for local network ${LOCAL_NETWORK}."
set +e

Loading…
Cancel
Save