diff options
author | Daniil Baturin <daniil@vyos.io> | 2020-08-20 20:25:48 +0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-20 20:25:48 +0700 |
commit | 6eac2ebc60e6091ab97594b94d56be0814614178 (patch) | |
tree | f436b52194cd9997857fafdb439e74c8c57d91a2 /python | |
parent | 41c847593551496770c4d08e09e32af638a30f40 (diff) | |
parent | 1658ff2a8b639fe89d48c48710beea0da1a02032 (diff) | |
download | vyos-1x-6eac2ebc60e6091ab97594b94d56be0814614178.tar.gz vyos-1x-6eac2ebc60e6091ab97594b94d56be0814614178.zip |
Merge pull request #532 from erkin/current
VRRP: T2761: Extend "show vrrp" op-mode command with router priority
Diffstat (limited to 'python')
-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()) |