mirror of
https://github.com/faucetsdn/ryu.git
synced 2026-05-09 14:26:10 +02:00
Add support for admin_state (role)
Signed-off-by: Anantha Ramaiah <ananth@ntti3.com> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This commit is contained in:
parent
c36e686fef
commit
8ad764f193
@ -115,6 +115,7 @@ class VRRPConfig(object):
|
||||
advertmisement_interval is in seconds as float. (Not in centiseconds)
|
||||
"""
|
||||
def __init__(self, version=vrrp.VRRP_VERSION_V3, vrid=None,
|
||||
admin_state=None,
|
||||
priority=vrrp.VRRP_PRIORITY_BACKUP_DEFAULT, ip_addresses=None,
|
||||
advertisement_interval=vrrp.VRRP_MAX_ADVER_INT_DEFAULT_IN_SEC,
|
||||
preempt_mode=True, preempt_delay=0, accept_mode=False):
|
||||
@ -124,6 +125,7 @@ class VRRPConfig(object):
|
||||
super(VRRPConfig, self).__init__()
|
||||
|
||||
self.version = version
|
||||
self.admin_state = admin_state
|
||||
self.vrid = vrid
|
||||
self.priority = priority
|
||||
self.ip_addresses = ip_addresses
|
||||
|
||||
@ -657,7 +657,9 @@ class VRRPRouterV3(VRRPRouter):
|
||||
|
||||
def start(self):
|
||||
self.state_change(vrrp_event.VRRP_STATE_INITIALIZE)
|
||||
if self.config.address_owner:
|
||||
# Check role here and change accordingly
|
||||
# Check config.admin_state
|
||||
if self.config.address_owner or self.config.admin_state == 'master':
|
||||
self.send_advertisement()
|
||||
|
||||
# This action should be done router on
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user