Skip to content

Commit 521217c

Browse files
authored
vr: fix vr in unknown state (more) (#3848)
This fixes similar issue with #3465. Meanwhile change log level of CsHelper.execute2 from DEBUG to INFO and fix some typo.
1 parent be112a0 commit 521217c

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

systemvm/debian/opt/cloud/bin/cs/CsHelper.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929

3030
PUBLIC_INTERFACES = {"router": "eth2", "vpcrouter": "eth1"}
3131

32-
STATE_COMMANDS = {"router": "ip addr | grep eth0 | grep inet | wc -l | xargs bash -c 'if [ $0 == 2 ]; then echo \"MASTER\"; else echo \"BACKUP\"; fi'",
33-
"vpcrouter": "ip addr | grep eth1 | grep state | awk '{print $9;}' | xargs bash -c 'if [ $0 == \"UP\" ]; then echo \"MASTER\"; else echo \"BACKUP\"; fi'"}
32+
STATE_COMMANDS = {"router": "ip addr show dev eth0 | grep inet | wc -l | xargs bash -c 'if [ $0 == 2 ]; then echo \"MASTER\"; else echo \"BACKUP\"; fi'",
33+
"vpcrouter": "ip addr show dev eth1 | grep state | awk '{print $9;}' | xargs bash -c 'if [ $0 == \"UP\" ]; then echo \"MASTER\"; else echo \"BACKUP\"; fi'"}
3434

3535

3636
def reconfigure_interfaces(router_config, interfaces):
@@ -215,7 +215,7 @@ def save_iptables(command, iptables_file):
215215

216216
def execute2(command, wait=True):
217217
""" Execute command """
218-
logging.debug("Executing: %s" % command)
218+
logging.info("Executing: %s" % command)
219219
p = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
220220
if wait:
221221
p.wait()

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def _redundant_on(self):
102102
command = "ip link show %s | grep 'state UP'" % dev
103103
devUp = CsHelper.execute(command)
104104
if devUp:
105-
logging.info("Device %s is present, let's start keepalive now." % dev)
105+
logging.info("Device %s is present, let's start keepalived now." % dev)
106106
isDeviceReady = True
107107

108108
if not isDeviceReady:
@@ -231,7 +231,7 @@ def set_fault(self):
231231
return
232232

233233
self.set_lock()
234-
logging.info("Router switched to fault mode")
234+
logging.info("Setting router to fault")
235235

236236
interfaces = [interface for interface in self.address.get_interfaces() if interface.is_public()]
237237
for interface in interfaces:

0 commit comments

Comments
 (0)