summaryrefslogtreecommitdiff
path: root/src/op_mode/vrrp.py
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@baturin.org>2018-08-10 21:35:11 +0200
committerDaniil Baturin <daniil@baturin.org>2018-08-10 21:35:11 +0200
commit5e58b540451fe7892f824bcc6b691c61ffd6a3d7 (patch)
tree640c176fbc1ab50d9fb75169a3e554b3cf6b2efb /src/op_mode/vrrp.py
parent6717754910504891a298b5ce3ff56adaf4ac617c (diff)
downloadvyos-1x-5e58b540451fe7892f824bcc6b691c61ffd6a3d7.tar.gz
vyos-1x-5e58b540451fe7892f824bcc6b691c61ffd6a3d7.zip
T666, T616: exit from op mode script if VRRP information is not available.
Diffstat (limited to 'src/op_mode/vrrp.py')
-rwxr-xr-xsrc/op_mode/vrrp.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/op_mode/vrrp.py b/src/op_mode/vrrp.py
index ba8b56de3..54e1bfb57 100755
--- a/src/op_mode/vrrp.py
+++ b/src/op_mode/vrrp.py
@@ -34,6 +34,7 @@ def print_summary():
json_data = vyos.keepalived.get_json_data()
except:
print("VRRP information is not available")
+ sys.exit(1)
groups = []
for group in json_data:
@@ -64,6 +65,7 @@ def print_statistics():
print(output)
except:
print("VRRP statistics are not available")
+ sys.exit(1)
def print_state_data():
try:
@@ -73,6 +75,7 @@ def print_state_data():
print(output)
except:
print("VRRP information is not available")
+ sys.exit(1)
parser = argparse.ArgumentParser()
group = parser.add_mutually_exclusive_group()