diff --git a/neutron/objects/ports.py b/neutron/objects/ports.py index 2f5c3b48ffe..d4ba5b8b76b 100644 --- a/neutron/objects/ports.py +++ b/neutron/objects/ports.py @@ -248,11 +248,6 @@ class PortDNS(base.NeutronDbObject): 'dns_domain': common_types.DomainNameField(), } - def obj_make_compatible(self, primitive, target_version): - _target_version = versionutils.convert_version_to_tuple(target_version) - if _target_version < (1, 1): - primitive.pop('dns_domain', None) - @base.NeutronObjectRegistry.register class SecurityGroupPortBinding(base.NeutronDbObject): @@ -500,8 +495,6 @@ class Port(base.NeutronDbObject): def obj_make_compatible(self, primitive, target_version): _target_version = versionutils.convert_version_to_tuple(target_version) - if _target_version < (1, 1): - primitive.pop('data_plane_status', None) if _target_version < (1, 2): binding_levels = primitive.get('binding_levels', []) for lvl in binding_levels: diff --git a/neutron/objects/qos/rule_type.py b/neutron/objects/qos/rule_type.py index bb84a7495f4..1a94fff09cf 100644 --- a/neutron/objects/qos/rule_type.py +++ b/neutron/objects/qos/rule_type.py @@ -14,8 +14,6 @@ from neutron_lib.objects import common_types from neutron_lib.plugins import constants from neutron_lib.plugins import directory from neutron_lib.services.qos import constants as qos_consts -from oslo_utils import versionutils -from oslo_versionedobjects import exception from oslo_versionedobjects import fields as obj_fields from neutron.objects import base @@ -74,12 +72,6 @@ class QosRuleType(base.NeutronObject): def get_values(cls, field, **kwargs): return [getattr(obj, field) for obj in cls.get_objects(**kwargs)] - def obj_make_compatible(self, primitive, target_version): - _target_version = versionutils.convert_version_to_tuple(target_version) - if _target_version < (1, 3): - raise exception.IncompatibleObjectVersion( - objver=target_version, objtype=self.__class__.__name__) - @base.NeutronObjectRegistry.register class QosRuleTypeDriver(base.NeutronObject): diff --git a/neutron/objects/trunk.py b/neutron/objects/trunk.py index 489b42b0e3d..a16bdf5486c 100644 --- a/neutron/objects/trunk.py +++ b/neutron/objects/trunk.py @@ -17,7 +17,6 @@ from neutron_lib import exceptions as n_exc from neutron_lib.objects import common_types from neutron_lib.objects import exceptions as o_exc from oslo_db import exception as o_db_exc -from oslo_utils import versionutils from oslo_versionedobjects import fields as obj_fields from neutron.objects import base @@ -138,9 +137,3 @@ class Trunk(base.NeutronDbObject): # or self.db_obj.standard_attr pass return _dict - - def obj_make_compatible(self, primitive, target_version): - _target_version = versionutils.convert_version_to_tuple(target_version) - - if _target_version < (1, 1): - primitive['tenant_id'] = primitive.pop('project_id') diff --git a/neutron/tests/unit/objects/qos/test_rule_type.py b/neutron/tests/unit/objects/qos/test_rule_type.py index 9c49145e583..ea7304618d3 100644 --- a/neutron/tests/unit/objects/qos/test_rule_type.py +++ b/neutron/tests/unit/objects/qos/test_rule_type.py @@ -19,7 +19,6 @@ from neutron_lib import constants as lib_consts from neutron_lib.db import constants as db_consts from neutron_lib.services.qos import constants as qos_consts from oslo_config import cfg -from oslo_versionedobjects import exception from neutron import manager from neutron.objects.qos import rule_type @@ -88,8 +87,3 @@ class QosRuleTypeObjectTestCase(test_base.BaseTestCase): def test_wrong_type(self): self.assertRaises(ValueError, rule_type.QosRuleType, type='bad_type') - - def test_object_version_degradation_less_than_1_3(self): - qos_rule_type = rule_type.QosRuleType() - self.assertRaises(exception.IncompatibleObjectVersion, - qos_rule_type.obj_to_primitive, '1.2') diff --git a/neutron/tests/unit/objects/test_base.py b/neutron/tests/unit/objects/test_base.py index 0ea1a07591c..5f8f63d694d 100644 --- a/neutron/tests/unit/objects/test_base.py +++ b/neutron/tests/unit/objects/test_base.py @@ -33,7 +33,6 @@ from oslo_db import exception as obj_exc from oslo_db.sqlalchemy import utils as db_utils from oslo_utils import uuidutils from oslo_versionedobjects import base as obj_base -from oslo_versionedobjects import exception from oslo_versionedobjects import fields as obj_fields from sqlalchemy import orm import testtools @@ -1699,14 +1698,6 @@ class BaseDbObjectTestCase(_BaseObjectTestCase, **remove_timestamps_from_fields( fields, self._test_class.fields)) - def test_downgrade_to_1_0(self): - for obj in self.objs: - try: - obj.obj_to_primitive(target_version='1.0') - except exception.IncompatibleObjectVersion: - # the only exception we should allow is IncompatibleVersion - pass - def test_get_object_create_update_delete(self): # Timestamps can't be initialized and multiple objects may use standard # attributes so we need to remove timestamps when creating objects diff --git a/neutron/tests/unit/objects/test_ports.py b/neutron/tests/unit/objects/test_ports.py index 6d442a6ee4f..c18e02a8469 100644 --- a/neutron/tests/unit/objects/test_ports.py +++ b/neutron/tests/unit/objects/test_ports.py @@ -379,12 +379,6 @@ class PortDbObjectTestCase(obj_test_base.BaseDbObjectTestCase, self.skipTest( 'Port object loads segment info without relationships') - def test_v1_1_to_v1_0_drops_data_plane_status(self): - port_new = self._create_test_port() - port_v1_0 = port_new.obj_to_primitive(target_version='1.0') - self.assertNotIn('data_plane_status', - port_v1_0['versioned_object.data']) - def test_v1_2_to_v1_1_drops_segment_id_in_binding_levels(self): port_new = self._create_test_port() segment = network.NetworkSegment( diff --git a/neutron/tests/unit/objects/test_trunk.py b/neutron/tests/unit/objects/test_trunk.py index df121eb663c..49dc1560307 100644 --- a/neutron/tests/unit/objects/test_trunk.py +++ b/neutron/tests/unit/objects/test_trunk.py @@ -172,14 +172,6 @@ class TrunkDbObjectTestCase(test_base.BaseDbObjectTestCase, if k in kwargs: self.assertEqual(kwargs[k], trunk[k]) - def test_v1_1_to_v1_0_drops_project_id(self): - trunk_new = self._test_create_trunk_with_subports( - self.db_objs[0]['port_id'], [1, 2]) - - trunk_v1_0 = trunk_new.obj_to_primitive(target_version='1.0') - self.assertNotIn('project_id', trunk_v1_0['versioned_object.data']) - self.assertIn('tenant_id', trunk_v1_0['versioned_object.data']) - def test_get_objects_tenant_id(self): trunk = t_obj.Trunk(context=self.context, project_id='faketenant',