diff options
author | khramshinr <khramshinr@gmail.com> | 2024-10-15 17:37:13 +0600 |
---|---|---|
committer | khramshinr <khramshinr@gmail.com> | 2024-10-17 15:11:45 +0600 |
commit | e42e32d48489329686ce6642848b189c0d262196 (patch) | |
tree | a078e3821b2e2f5cc13d22ad3f88cc46ae2a2b3b /python | |
parent | e5d2ac54150922640c08bacab124e96c7bbd1f7f (diff) | |
download | vyos-1x-e42e32d48489329686ce6642848b189c0d262196.tar.gz vyos-1x-e42e32d48489329686ce6642848b189c0d262196.zip |
T4583: Rewrite VRRP op-mode to vyos.opmode format
Diffstat (limited to 'python')
-rw-r--r-- | python/vyos/ifconfig/vrrp.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/python/vyos/ifconfig/vrrp.py b/python/vyos/ifconfig/vrrp.py index ee9336d1a..d3d31cc07 100644 --- a/python/vyos/ifconfig/vrrp.py +++ b/python/vyos/ifconfig/vrrp.py @@ -99,11 +99,11 @@ class VRRP(object): timeout=30) return read_file(fname) + except FileNotFoundError: + raise VRRPNoData("VRRP data is not available (process not running or no active groups)") except OSError: # raised by vyos.utils.file.read_file raise VRRPNoData("VRRP data is not available (wait time exceeded)") - except FileNotFoundError: - raise VRRPNoData("VRRP data is not available (process not running or no active groups)") except Exception: name = cls._name[what] raise VRRPError(f'VRRP {name} is not available') @@ -136,7 +136,7 @@ class VRRP(object): headers = ["Name", "Interface", "VRID", "State", "Priority", "Last Transition"] groups = [] - data = json.loads(data) + data = json.loads(data) if isinstance(data, str) else data for group in data: data = group['data'] |