summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorDmitriyEshenko <dmitriy.eshenko@vyos.io>2020-02-07 21:45:53 +0000
committerDmitriyEshenko <dmitriy.eshenko@vyos.io>2020-02-07 21:45:53 +0000
commit79ef46e8af11c6fc57f9465b1b9ac97e775f2c89 (patch)
treea1dab16b2ccda50666dea89c6511439767b0922f /python
parentebfd8e5e6ef64f86291b28ad08225fb497c32655 (diff)
downloadvyos-1x-79ef46e8af11c6fc57f9465b1b9ac97e775f2c89.tar.gz
vyos-1x-79ef46e8af11c6fc57f9465b1b9ac97e775f2c89.zip
vrrp: T1884: Add mode-force for run transition-scripts without checking previous state
Diffstat (limited to 'python')
-rw-r--r--python/vyos/keepalived.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/python/vyos/keepalived.py b/python/vyos/keepalived.py
index 4114aa736..6d1dbe12c 100644
--- a/python/vyos/keepalived.py
+++ b/python/vyos/keepalived.py
@@ -38,6 +38,15 @@ def vrrp_running():
def keepalived_running():
return vyos.util.process_running(pid_file)
+# Clear VRRP data after showing
+def remove_vrrp_data(data_file):
+ if data_file == "json" and os.path.exists(json_file):
+ os.remove(json_file)
+ elif data_file == "stats" and os.path.exists(stats_file):
+ os.remove(stats_file)
+ elif data_file == "state" and os.path.exists(state_file):
+ os.remove(state_file)
+
def force_state_data_dump():
pid = vyos.util.read_file(pid_file)
os.kill(int(pid), signal.SIGUSR1)