Add debug information in BridgeCreateEvent
Added extra information (bridge name) when a bridge creation event is received. Trivial fix: changed BridgeCreateEvent __init__ argument to "agent", as requested in [1]. [1] https://review.openstack.org/#/c/612153/ Partial-Bug: #1789592 Change-Id: I0bca7e71fb379febfe2131566bb8c1bf8f039183
This commit is contained in:
parent
22c9cf3d95
commit
f999970755
|
@ -12,6 +12,7 @@
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
import logging
|
||||||
import os
|
import os
|
||||||
import threading
|
import threading
|
||||||
|
|
||||||
|
@ -32,6 +33,7 @@ from neutron.conf.agent import ovsdb_api
|
||||||
TransactionQueue = moves.moved_class(_connection.TransactionQueue,
|
TransactionQueue = moves.moved_class(_connection.TransactionQueue,
|
||||||
'TransactionQueue', __name__)
|
'TransactionQueue', __name__)
|
||||||
Connection = moves.moved_class(_connection.Connection, 'Connection', __name__)
|
Connection = moves.moved_class(_connection.Connection, 'Connection', __name__)
|
||||||
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
ovsdb_api.register_ovsdb_api_opts()
|
ovsdb_api.register_ovsdb_api_opts()
|
||||||
|
@ -59,14 +61,15 @@ def configure_ssl_conn():
|
||||||
|
|
||||||
class BridgeCreateEvent(idl_event.RowEvent):
|
class BridgeCreateEvent(idl_event.RowEvent):
|
||||||
|
|
||||||
def __init__(self, metadata_agent):
|
def __init__(self, agent):
|
||||||
self.agent = metadata_agent
|
self.agent = agent
|
||||||
table = 'Bridge'
|
table = 'Bridge'
|
||||||
super(BridgeCreateEvent, self).__init__((self.ROW_CREATE, ),
|
super(BridgeCreateEvent, self).__init__((self.ROW_CREATE, ),
|
||||||
table, None)
|
table, None)
|
||||||
self.event_name = 'BridgeCreateEvent'
|
self.event_name = 'BridgeCreateEvent'
|
||||||
|
|
||||||
def run(self, event, row, old):
|
def run(self, event, row, old):
|
||||||
|
LOG.debug('%s, bridge name: %s', self.event_name, row.name)
|
||||||
self.agent.add_bridge(str(row.name))
|
self.agent.add_bridge(str(row.name))
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue