From 79ef46e8af11c6fc57f9465b1b9ac97e775f2c89 Mon Sep 17 00:00:00 2001 From: DmitriyEshenko Date: Fri, 7 Feb 2020 21:45:53 +0000 Subject: vrrp: T1884: Add mode-force for run transition-scripts without checking previous state --- python/vyos/keepalived.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'python') 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) -- cgit v1.2.3