summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@baturin.org>2021-02-11 07:22:46 +0100
committerDaniil Baturin <daniil@vyos.io>2021-02-11 08:53:18 +0200
commit186e26603b6fa08d9f94fb282fda8816954ab9ad (patch)
tree7b81ece9f1ee3d83d9f56448813c19c9cc16fcbe
parent2102a26a5e96b5c83a79de08e6f3fd5ec5f99e79 (diff)
downloadvyos-1x-186e26603b6fa08d9f94fb282fda8816954ab9ad.tar.gz
vyos-1x-186e26603b6fa08d9f94fb282fda8816954ab9ad.zip
T3248: add the missing mode-force option, just a dummy for issuing deprecation warnings.
-rw-r--r--interface-definitions/vrrp.xml.in6
-rwxr-xr-xsrc/conf_mode/vrrp.py6
2 files changed, 12 insertions, 0 deletions
diff --git a/interface-definitions/vrrp.xml.in b/interface-definitions/vrrp.xml.in
index caa9f4a33..1bb57d165 100644
--- a/interface-definitions/vrrp.xml.in
+++ b/interface-definitions/vrrp.xml.in
@@ -212,6 +212,12 @@
</constraint>
</properties>
</leafNode>
+ <leafNode name="mode-force">
+ <properties>
+ <valueless/>
+ <help>Disable VRRP state checking (deprecated, will be removed in VyOS 1.4)</help>
+ </properties>
+ </leafNode>
</children>
</node>
<leafNode name="virtual-address">
diff --git a/src/conf_mode/vrrp.py b/src/conf_mode/vrrp.py
index 4510dd3e7..3ccc7d66b 100755
--- a/src/conf_mode/vrrp.py
+++ b/src/conf_mode/vrrp.py
@@ -75,6 +75,7 @@ def get_config(config=None):
group["backup_script"] = config.return_value("transition-script backup")
group["fault_script"] = config.return_value("transition-script fault")
group["stop_script"] = config.return_value("transition-script stop")
+ group["script_mode_force"] = config.exists("transition-script mode-force")
if config.exists("no-preempt"):
group["preempt"] = False
@@ -183,6 +184,11 @@ def verify(data):
if isinstance(pa, IPv4Address):
raise ConfigError("VRRP group {0} uses IPv6 but its peer-address is IPv4".format(group["name"]))
+ # Warn the user about the deprecated mode-force option
+ if group["script_mode_force"]:
+ print("""Warning: "transition-script mode-force" VRRP option is deprecated and will be removed in VyOS 1.4.""")
+ print("""It's no longer necessary, so you can safely remove it from your config now.""")
+
# Disallow same VRID on multiple interfaces
_groups = sorted(vrrp_groups, key=(lambda x: x["interface"]))
count = len(_groups) - 1