Skip to content

Commit 5219be1

Browse files
committed
Configure rVPC for router.redundant.vrrp.interval advert_int setting
1 parent c33358d commit 5219be1

3 files changed

Lines changed: 9 additions & 0 deletions

File tree

systemvm/patches/debian/config/opt/cloud/bin/cs/CsDatabag.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,3 +148,8 @@ def get_gateway(self):
148148
if "gateway" in self.idata():
149149
return self.idata()['gateway']
150150
return False
151+
152+
def get_advert_int(self):
153+
if 'advert_int' in self.idata():
154+
return self.idata()['advert_int']
155+
return 1

systemvm/patches/debian/config/opt/cloud/bin/cs/CsFile.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ def section(self, start, end, content):
113113
self.new_config[sind:eind] = content
114114

115115
def greplace(self, search, replace):
116+
logging.debug("Searching for %s and replacing with %s" % (search, replace))
116117
self.new_config = [w.replace(search, replace) for w in self.new_config]
117118

118119
def search(self, search, replace):

systemvm/patches/debian/config/opt/cloud/bin/cs/CsRedundant.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,9 @@ def _redundant_on(self):
138138
" router_id ", " router_id %s" % self.cl.get_name())
139139
keepalived_conf.search(
140140
" interface ", " interface %s" % guest.get_device())
141+
keepalived_conf.search(
142+
" advert_int ", " advert_int %s" % self.cl.get_advert_int())
143+
141144
keepalived_conf.greplace("[RROUTER_BIN_PATH]", self.CS_ROUTER_DIR)
142145
keepalived_conf.section("authentication {", "}", [
143146
" auth_type AH \n", " auth_pass %s\n" % self.cl.get_router_password()])

0 commit comments

Comments
 (0)