From ffe416c0c0d6212fde0727bf6593280222cf1e95 Mon Sep 17 00:00:00 2001 From: Rodolfo Alonso Hernandez Date: Wed, 30 Sep 2020 15:59:22 +0000 Subject: [PATCH] Change reference to OvnDbNotifyHandler._watched_events Since [1], RowEventHandler._watched_events do not use name mangling. OvnDbNotifyHandler, inheriting from RowEventHandler, can access to this variable. [1]https://review.opendev.org/#/c/752797/ Change-Id: I545c31977799c4ea51e037b631a49306da9c4a3b Partial-Bug: #1897928 (cherry picked from commit ac08e89124bd7aad532e86b12a1e67b9550387ef) --- .../drivers/ovn/mech_driver/ovsdb/test_ovsdb_monitor.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/neutron/tests/unit/plugins/ml2/drivers/ovn/mech_driver/ovsdb/test_ovsdb_monitor.py b/neutron/tests/unit/plugins/ml2/drivers/ovn/mech_driver/ovsdb/test_ovsdb_monitor.py index 53be4de4e45..47a234696ec 100644 --- a/neutron/tests/unit/plugins/ml2/drivers/ovn/mech_driver/ovsdb/test_ovsdb_monitor.py +++ b/neutron/tests/unit/plugins/ml2/drivers/ovn/mech_driver/ovsdb/test_ovsdb_monitor.py @@ -98,7 +98,12 @@ class TestOvnDbNotifyHandler(base.BaseTestCase): def setUp(self): super(TestOvnDbNotifyHandler, self).setUp() self.handler = ovsdb_monitor.OvnDbNotifyHandler(mock.ANY) - self.watched_events = self.handler._RowEventHandler__watched_events + # NOTE(ralonsoh): once the ovsdbapp library version is bumped beyond + # 1.5.0, the first assignation (using name mangling) can be deleted. + try: + self.watched_events = self.handler._RowEventHandler__watched_events + except AttributeError: + self.watched_events = self.handler._watched_events def test_watch_and_unwatch_events(self): expected_events = set()