Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
---
lnst/Recipes/ENRT/VlansOverBondRecipe.py | 18 ++++++------------
lnst/Recipes/ENRT/VlansOverTeamRecipe.py | 18 ++++++------------
lnst/Recipes/ENRT/VlansRecipe.py | 18 ++++++------------
3 files changed, 18 insertions(+), 36 deletions(-)
diff --git a/lnst/Recipes/ENRT/VlansOverBondRecipe.py
b/lnst/Recipes/ENRT/VlansOverBondRecipe.py
index 5b1ee267..a2e9947d 100644
--- a/lnst/Recipes/ENRT/VlansOverBondRecipe.py
+++ b/lnst/Recipes/ENRT/VlansOverBondRecipe.py
@@ -114,18 +114,12 @@ class VlansOverBondRecipe(VlanPingEvaluatorMixin,
net_addr6 = "fc00:0:0"
for i, host in enumerate([host1, host2]):
- host.vlan0.ip_add(ipaddress(net_addr + '.10' + '.' +
str(i+1)
- + "/24"))
- host.vlan0.ip_add(ipaddress(net_addr6 + ":1::" + str(i+1) +
- "/64"))
- host.vlan1.ip_add(ipaddress(net_addr + '.20' + '.' + str(i+1)
+
- "/24"))
- host.vlan1.ip_add(ipaddress(net_addr6 + ":2::" + str(i+1) +
- "/64"))
- host.vlan2.ip_add(ipaddress(net_addr + '.30' + '.' + str(i+1)
+
- "/24"))
- host.vlan2.ip_add(ipaddress(net_addr6 + ":3::" + str(i+1) +
- "/64"))
+ host.vlan0.ip_add(ipaddress('{}.10.{}/24'.format(net_addr, i+1)))
+ host.vlan1.ip_add(ipaddress('{}.20.{}/24'.format(net_addr, i+1)))
+ host.vlan2.ip_add(ipaddress('{}.30.{}/24'.format(net_addr, i+1)))
+ host.vlan0.ip_add(ipaddress('{}:1::{}/64'.format(net_addr6, i+1)))
+ host.vlan1.ip_add(ipaddress('{}:2::{}/64'.format(net_addr6, i+1)))
+ host.vlan2.ip_add(ipaddress('{}:3::{}/64'.format(net_addr6, i+1)))
for dev in [host1.eth0, host1.eth1, host1.bond0, host1.vlan0,
host1.vlan1, host1.vlan2, host2.eth0, host2.vlan0,
diff --git a/lnst/Recipes/ENRT/VlansOverTeamRecipe.py
b/lnst/Recipes/ENRT/VlansOverTeamRecipe.py
index b51047cf..ed1e6d53 100644
--- a/lnst/Recipes/ENRT/VlansOverTeamRecipe.py
+++ b/lnst/Recipes/ENRT/VlansOverTeamRecipe.py
@@ -57,18 +57,12 @@ class VlansOverTeamRecipe(VlanPingEvaluatorMixin,
net_addr6 = "fc00:0:0"
for i, host in enumerate([host1, host2]):
- host.vlan0.ip_add(ipaddress(net_addr + '.10' + '.' +
str(i+1)
- + "/24"))
- host.vlan0.ip_add(ipaddress(net_addr6 + ":1::" + str(i+1) +
- "/64"))
- host.vlan1.ip_add(ipaddress(net_addr + '.20' + '.' +
str(i+1)
- + "/24"))
- host.vlan1.ip_add(ipaddress(net_addr6 + ":2::" + str(i+1) +
- "/64"))
- host.vlan2.ip_add(ipaddress(net_addr + '.30' + '.' +
str(i+1)
- + "/24"))
- host.vlan2.ip_add(ipaddress(net_addr6 + ":3::" + str(i+1) +
- "/64"))
+ host.vlan0.ip_add(ipaddress('{}.10.{}/24'.format(net_addr, i+1)))
+ host.vlan1.ip_add(ipaddress('{}.20.{}/24'.format(net_addr, i+1)))
+ host.vlan2.ip_add(ipaddress('{}.30.{}/24'.format(net_addr, i+1)))
+ host.vlan0.ip_add(ipaddress('{}:1::{}/64'.format(net_addr6, i+1)))
+ host.vlan1.ip_add(ipaddress('{}:2::{}/64'.format(net_addr6, i+1)))
+ host.vlan2.ip_add(ipaddress('{}:3::{}/64'.format(net_addr6, i+1)))
for dev in [host1.eth0, host1.eth1, host1.team0, host1.vlan0,
host1.vlan1, host1.vlan2, host2.eth0, host2.vlan0, host2.vlan1,
diff --git a/lnst/Recipes/ENRT/VlansRecipe.py b/lnst/Recipes/ENRT/VlansRecipe.py
index d38663d5..6cf50d57 100644
--- a/lnst/Recipes/ENRT/VlansRecipe.py
+++ b/lnst/Recipes/ENRT/VlansRecipe.py
@@ -88,18 +88,12 @@ class VlansRecipe(VlanPingEvaluatorMixin,
net_addr6 = "fc00:0:0"
for i, host in enumerate([host1, host2]):
- host.vlan0.ip_add(ipaddress(net_addr + '.10' + '.' + str(i+1)
+
- "/24"))
- host.vlan0.ip_add(ipaddress(net_addr6 + ":1::" + str(i+1) +
- "/64"))
- host.vlan1.ip_add(ipaddress(net_addr + '.20' + '.' + str(i+1)
+
- "/24"))
- host.vlan1.ip_add(ipaddress(net_addr6 + ":2::" + str(i+1) +
- "/64"))
- host.vlan2.ip_add(ipaddress(net_addr + '.30' + '.' + str(i+1)
+
- "/24"))
- host.vlan2.ip_add(ipaddress(net_addr6 + ":3::" + str(i+1) +
- "/64"))
+ host.vlan0.ip_add(ipaddress('{}.10.{}/24'.format(net_addr, i+1)))
+ host.vlan1.ip_add(ipaddress('{}.20.{}/24'.format(net_addr, i+1)))
+ host.vlan2.ip_add(ipaddress('{}.30.{}/24'.format(net_addr, i+1)))
+ host.vlan0.ip_add(ipaddress('{}:1::{}/64'.format(net_addr6, i+1)))
+ host.vlan1.ip_add(ipaddress('{}:2::{}/64'.format(net_addr6, i+1)))
+ host.vlan2.ip_add(ipaddress('{}:3::{}/64'.format(net_addr6, i+1)))
for dev in [host.eth0, host.vlan0, host.vlan1, host.vlan2]:
dev.up()
--
2.21.1