summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNikos Karandreas <nick@intracom-telecom.com>2018-09-26 08:50:14 +0000
committerGerrit Code Review <gerrit@opnfv.org>2018-09-26 08:50:14 +0000
commitbdec0f1283bc91a4c78b858a28d25f76a0413cd2 (patch)
tree46723624e49eb2f5bec818c7453c367ed55bdf91
parent6ffe81bf06727cb49be31cc0dd87aa506a48a834 (diff)
parent506187a2e2a7e9232954192d1cf45aab76a0c6a6 (diff)
Merge "Replace % operator with format method"
-rw-r--r--sdnvpn/artifacts/quagga_setup.sh20
-rw-r--r--sdnvpn/lib/quagga.py8
2 files changed, 14 insertions, 14 deletions
diff --git a/sdnvpn/artifacts/quagga_setup.sh b/sdnvpn/artifacts/quagga_setup.sh
index fbd229f..b3bf786 100644
--- a/sdnvpn/artifacts/quagga_setup.sh
+++ b/sdnvpn/artifacts/quagga_setup.sh
@@ -9,22 +9,22 @@ echo 'ubuntu:opnfv' | chpasswd
sleep 100
# Variables to be filled in with python
-NEIGHBOR_IP=$1
-OWN_IP=$2
+NEIGHBOR_IP={0}
+OWN_IP={1}
# directly access the instance from the external net without NAT
-EXT_NET_MASK=$3
-IP_PREFIX=$4
-RD=$5
-IRT=$6
-ERT=$7
+EXT_NET_MASK={2}
+IP_PREFIX={3}
+RD={4}
+IRT={5}
+ERT={6}
-if [[ $(getent hosts | awk '{print $2}') != *"$(cat /etc/hostname | awk '{print $1}')"* ]]
+if [[ $(getent hosts | awk '{{print $2}}') != *"$(cat /etc/hostname | awk '{{print $1}}')"* ]]
then
-echo "127.0.1.1 $(cat /etc/hostname | awk '{print $1}')" | tee -a /etc/hosts
+echo "127.0.1.1 $(cat /etc/hostname | awk '{{print $1}}')" | tee -a /etc/hosts
fi
quagga_int=''
-for net_int in $(netstat -ia | awk 'NR>2{print $1}');
+for net_int in $(netstat -ia | awk 'NR>2{{print $1}}');
do
if [ -z "$(ifconfig | grep $net_int)" ]
then
diff --git a/sdnvpn/lib/quagga.py b/sdnvpn/lib/quagga.py
index 0ea206e..f11e188 100644
--- a/sdnvpn/lib/quagga.py
+++ b/sdnvpn/lib/quagga.py
@@ -48,10 +48,10 @@ def gen_quagga_setup_script(controller_ip,
ip_prefix, rd, irt, ert):
with open(COMMON_CONFIG.quagga_setup_script_path) as f:
template = f.read()
- script = template % (controller_ip,
- fake_floating_ip,
- ext_net_mask,
- ip_prefix, rd, irt, ert)
+ script = template.format(controller_ip,
+ fake_floating_ip,
+ ext_net_mask,
+ ip_prefix, rd, irt, ert)
return script