Skip to content

Commit 9c0eee4

Browse files
committed
Configure rVPC for router.redundant.vrrp.interval advert_int setting
1 parent 2bfb12c commit 9c0eee4

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,3 +154,7 @@ def get_use_ext_dns(self):
154154
return self.idata()['useextdns']
155155
return False
156156

157+
def get_advert_int(self):
158+
if 'advert_int' in self.idata():
159+
return self.idata()['advert_int']
160+
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)