Fix restart ovs logistic.

This commit is contained in:
Hui Xiang 2015-01-08 17:20:29 +08:00
parent f52eda2db5
commit b794179536
2 changed files with 25 additions and 22 deletions

View File

@ -8,6 +8,7 @@
# Copyright 2014 Canonical Ltd.
#
# Authors: Hui Xiang <hui.xiang@canonical.com>
# Edward Hope-Morley <edward.hope-morley@canonical.com>
#
# OCF instance parameters:
# OCF_RESKEY_file

View File

@ -374,15 +374,17 @@ class MonitorNeutronAgentsDaemon(Daemon):
try:
OVS_AGENT = 'Open vSwitch agent'
agent = quantum.show_agent(agent_type=OVS_AGENT,
host=self.get_hostname)
agents = quantum.list_agents(agent_type=OVS_AGENT)
except Exception as e:
LOG.error('No ovs agent found on localhost, error:%s.' % e)
return
for agent in agents['agents']:
if self.is_same_host(agent['host']):
conf = agent['configurations']
if conf['tunnel_types'] == 'gre' and conf['l2_population'] \
if 'gre' in conf['tunnel_types'] and conf['l2_population'] \
and conf['devices']:
LOG.warning('local ovs agent:%s' % agent)
ovs_output = subprocess.check_output(['ovs-vsctl',
'list-ports', 'br-tun'])
ports = ovs_output.strip().split('\n')