diff options
author | erkin <me@erkin.party> | 2020-08-20 16:21:43 +0300 |
---|---|---|
committer | erkin <me@erkin.party> | 2020-08-20 16:21:43 +0300 |
commit | 1658ff2a8b639fe89d48c48710beea0da1a02032 (patch) | |
tree | f436b52194cd9997857fafdb439e74c8c57d91a2 /python/vyos/ifconfig/vrrp.py | |
parent | 41c847593551496770c4d08e09e32af638a30f40 (diff) | |
download | vyos-1x-1658ff2a8b639fe89d48c48710beea0da1a02032.tar.gz vyos-1x-1658ff2a8b639fe89d48c48710beea0da1a02032.zip |
VRRP: T2761: Extend "show vrrp" op-mode command with router priority
Diffstat (limited to 'python/vyos/ifconfig/vrrp.py')
-rw-r--r-- | python/vyos/ifconfig/vrrp.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/python/vyos/ifconfig/vrrp.py b/python/vyos/ifconfig/vrrp.py index 5e6387881..01a7cc7ab 100644 --- a/python/vyos/ifconfig/vrrp.py +++ b/python/vyos/ifconfig/vrrp.py @@ -96,7 +96,7 @@ class VRRP(object): pid = util.read_file(cls.location['pid']) os.kill(int(pid), cls._signal[what]) - # shoud look for file size change ? + # should look for file size change? sleep(0.2) return util.read_file(fname) except FileNotFoundError: @@ -126,8 +126,8 @@ class VRRP(object): return disabled @classmethod - def format (cls, data): - headers = ["Name", "Interface", "VRID", "State", "Last Transition"] + def format(cls, data): + headers = ["Name", "Interface", "VRID", "State", "Priority", "Last Transition"] groups = [] data = json.loads(data) @@ -138,11 +138,12 @@ class VRRP(object): intf = data['ifp_ifname'] vrid = data['vrid'] state = cls.decode_state(data["state"]) + priority = data['effective_priority'] since = int(time() - float(data['last_transition'])) last = util.seconds_to_human(since) - groups.append([name, intf, vrid, state, last]) + groups.append([name, intf, vrid, state, priority, last]) # add to the active list disabled instances groups.extend(cls.disabled()) |