From ecab2c6aaba4a495be6f81548f1367a35b7e74a4 Mon Sep 17 00:00:00 2001 From: Hui Xiang Date: Mon, 19 Jan 2015 14:54:42 +0800 Subject: [PATCH] Fix error in check_local_agents --- files/neutron-ha-monitor.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/files/neutron-ha-monitor.py b/files/neutron-ha-monitor.py index cd3d04f3..7e1bec7e 100644 --- a/files/neutron-ha-monitor.py +++ b/files/neutron-ha-monitor.py @@ -362,7 +362,7 @@ class MonitorNeutronAgentsDaemon(Daemon): conf = agent['configurations'] if 'gre' in conf['tunnel_types'] and conf['l2_population'] \ and conf['devices']: - LOG.warning('local ovs agent:%s' % agent) + LOG.debug('local ovs agent:%s' % agent) ovs_output = subprocess.check_output(['ovs-vsctl', 'list-ports', 'br-tun']) ports = ovs_output.strip().split('\n') @@ -388,15 +388,17 @@ class MonitorNeutronAgentsDaemon(Daemon): status = ['sudo', 'service', s, 'status'] restart = ['sudo', 'service', s, 'restart'] start = ['sudo', 'service', s, 'start'] - stop = 'neutron-vpn-agent stop/waiting' + stop = '%s stop/waiting' % s try: output = subprocess.check_output(status) if output.strip() == stop: subprocess.check_output(start) + LOG.error('Restart service: %s' % s) if s == 'neutron-metadata-agent': subprocess.check_output(['sudo', 'service', 'neutron-vpn-agent', 'restart']) + LOG.error('Restart neutron-vpn-agent') except subprocess.CalledProcessError: LOG.error('Restart service: %s' % s) subprocess.check_output(restart)