summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rwxr-xr-xsrc/conf_mode/vrrp.py6
-rwxr-xr-xsrc/migration-scripts/vrrp/2-to-310
2 files changed, 13 insertions, 3 deletions
diff --git a/src/conf_mode/vrrp.py b/src/conf_mode/vrrp.py
index ba156e915..ffe9dd276 100755
--- a/src/conf_mode/vrrp.py
+++ b/src/conf_mode/vrrp.py
@@ -72,8 +72,8 @@ def verify(vrrp):
if 'interface' not in group_config:
raise ConfigError(f'Interface is required but not set in VRRP group "{group}"')
- if 'virtual_address' not in group_config:
- raise ConfigError(f'virtual-address is required but not set in VRRP group "{group}"')
+ if 'address' not in group_config:
+ raise ConfigError(f'Virtual IP address is required but not set in VRRP group "{group}"')
if 'authentication' in group_config:
if not {'password', 'type'} <= set(group_config['authentication']):
@@ -92,7 +92,7 @@ def verify(vrrp):
# XXX: filter on map object is destructive, so we force it to list.
# Additionally, filter objects always evaluate to True, empty or not,
# so we force them to lists as well.
- vaddrs = list(map(lambda i: ip_interface(i), group_config['virtual_address']))
+ vaddrs = list(map(lambda i: ip_interface(i), group_config['address']))
vaddrs4 = list(filter(lambda x: isinstance(x, IPv4Interface), vaddrs))
vaddrs6 = list(filter(lambda x: isinstance(x, IPv6Interface), vaddrs))
diff --git a/src/migration-scripts/vrrp/2-to-3 b/src/migration-scripts/vrrp/2-to-3
index b96ca139d..1151ae18c 100755
--- a/src/migration-scripts/vrrp/2-to-3
+++ b/src/migration-scripts/vrrp/2-to-3
@@ -44,6 +44,16 @@ if config.exists(base + ['group']):
if config.exists(tmp):
config.delete(tmp)
+ # Rename virtual-address -> address
+ tmp = group_base + ['virtual-address']
+ if config.exists(tmp):
+ config.rename(tmp, 'address')
+
+ # Rename virtual-address-excluded -> excluded-address
+ tmp = group_base + ['virtual-address-excluded']
+ if config.exists(tmp):
+ config.rename(tmp, 'excluded-address')
+
try:
with open(file_name, 'w') as f:
f.write(config.to_string())