From 0bf70acc430c3d7965730223a070e4c553db5bff Mon Sep 17 00:00:00 2001 From: Adit Sarfaty Date: Thu, 8 Sep 2016 12:38:42 +0300 Subject: [PATCH] Fix Admin utils tests - resources registration Commit I8a40f38d7c0e5aeca257ba62115fa9b02ad5aa93 broke our tests Change-Id: Ib2d92da04efe4d349a041a6a137497cdaed06209 --- vmware_nsx/tests/unit/shell/test_admin_utils.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/vmware_nsx/tests/unit/shell/test_admin_utils.py b/vmware_nsx/tests/unit/shell/test_admin_utils.py index 1a31ee1b11..c3dae4f737 100644 --- a/vmware_nsx/tests/unit/shell/test_admin_utils.py +++ b/vmware_nsx/tests/unit/shell/test_admin_utils.py @@ -24,6 +24,7 @@ from oslo_utils import uuidutils from neutron.callbacks import registry from neutron.common import config as neutron_config from neutron.db import servicetype_db # noqa +from neutron.quota import resource_registry from neutron.tests import base from neutron.tests.unit.db import test_db_base_plugin_v2 as test_n_plugin @@ -48,11 +49,15 @@ class AbstractTestAdminUtils(base.BaseTestCase): super(AbstractTestAdminUtils, self).setUp() + # remove resource registration conflicts + resource_registry.unregister_all_resources() + # Init the neutron config neutron_config.init(args=['--config-file', BASE_CONF_PATH, '--config-file', NSX_INI_PATH]) self._init_mock_plugin() self._init_resource_plugin() + self.addCleanup(resource_registry.unregister_all_resources) @abc.abstractmethod def _init_mock_plugin(self):