From e42e32d48489329686ce6642848b189c0d262196 Mon Sep 17 00:00:00 2001 From: khramshinr Date: Tue, 15 Oct 2024 17:37:13 +0600 Subject: T4583: Rewrite VRRP op-mode to vyos.opmode format --- python/vyos/ifconfig/vrrp.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'python') 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'] -- cgit v1.2.3