diff --git a/vmware_nsx/api_replay/utils.py b/vmware_nsx/api_replay/utils.py index c3fe51d410..700657e818 100644 --- a/vmware_nsx/api_replay/utils.py +++ b/vmware_nsx/api_replay/utils.py @@ -14,7 +14,6 @@ # under the License. -from neutron.api.v2 import attributes from neutron_lib.api import attributes as lib_attrs from oslo_config import cfg from oslo_utils import uuidutils @@ -27,7 +26,7 @@ def _fixup_res_dict(context, attr_name, res_dict, check_allow_post=True): # for the id field if one is not found ONLY if running in api_replay_mode. if cfg.CONF.api_replay_mode and 'id' not in res_dict: res_dict['id'] = uuidutils.generate_uuid() - attr_info = attributes.RESOURCE_ATTRIBUTE_MAP[attr_name] + attr_info = lib_attrs.RESOURCES[attr_name] attr_ops = lib_attrs.AttributeInfo(attr_info) try: attr_ops.populate_project_id(context, res_dict, True) diff --git a/vmware_nsx/tests/unit/nsx_v3/test_api_replay.py b/vmware_nsx/tests/unit/nsx_v3/test_api_replay.py index 36793c61f9..135956e60f 100644 --- a/vmware_nsx/tests/unit/nsx_v3/test_api_replay.py +++ b/vmware_nsx/tests/unit/nsx_v3/test_api_replay.py @@ -15,7 +15,7 @@ from vmware_nsx.tests.unit.nsx_v3 import test_plugin -from neutron.api.v2 import attributes +from neutron_lib.api import attributes from neutron_lib.plugins import directory from oslo_config import cfg @@ -39,7 +39,7 @@ class TestApiReplay(test_plugin.NsxV3PluginTestCaseMixin): # Revert the attributes map back to normal for attr_name in ('ports', 'networks', 'security_groups', 'security_group_rules', 'routers', 'policies'): - attr_info = attributes.RESOURCE_ATTRIBUTE_MAP[attr_name] + attr_info = attributes.RESOURCES[attr_name] attr_info['id']['allow_post'] = False super(TestApiReplay, self).tearDown()