consume get_updatable_fields from neutron-lib
The neutron.objects.base.get_updatable_fields function is now in neutron-lib. This patch consumes it by removing the function from neutron and using lib's version instead. NeutronLibImpact Change-Id: Ia06ad97e053dd59a1163f6c31199dde07bb0ffbf
This commit is contained in:
parent
6e5349963f
commit
c8c201bca9
|
@ -42,14 +42,6 @@ LOG = logging.getLogger(__name__)
|
|||
_NO_DB_MODEL = object()
|
||||
|
||||
|
||||
def get_updatable_fields(cls, fields):
|
||||
fields = fields.copy()
|
||||
for field in cls.fields_no_update:
|
||||
if field in fields:
|
||||
del fields[field]
|
||||
return fields
|
||||
|
||||
|
||||
def get_object_class_by_model(model):
|
||||
for obj_class in NeutronObjectRegistry.obj_classes().values():
|
||||
obj_class = obj_class[0]
|
||||
|
|
|
@ -687,7 +687,7 @@ class _BaseObjectTestCase(object):
|
|||
return keys
|
||||
|
||||
def get_updatable_fields(self, fields):
|
||||
return base.get_updatable_fields(self._test_class, fields)
|
||||
return obj_utils.get_updatable_fields(self._test_class, fields)
|
||||
|
||||
@classmethod
|
||||
def _is_test_class(cls, obj):
|
||||
|
|
|
@ -17,6 +17,7 @@ from neutron_lib.callbacks import events
|
|||
from neutron_lib import constants as lib_constants
|
||||
from neutron_lib import context
|
||||
from neutron_lib import exceptions as lib_exc
|
||||
from neutron_lib.objects import utils as obj_utils
|
||||
from neutron_lib.placement import constants as pl_constants
|
||||
from neutron_lib.plugins import constants as plugins_constants
|
||||
from neutron_lib.plugins import directory
|
||||
|
@ -27,7 +28,6 @@ from oslo_utils import uuidutils
|
|||
from neutron.common import constants
|
||||
from neutron.common import exceptions as n_exc
|
||||
from neutron import manager
|
||||
from neutron.objects import base as base_object
|
||||
from neutron.objects.qos import policy as policy_object
|
||||
from neutron.objects.qos import rule as rule_object
|
||||
from neutron.services.qos import qos_plugin
|
||||
|
@ -495,7 +495,7 @@ class TestQosPlugin(base.BaseQosTestCase):
|
|||
mock_manager.attach_mock(self.qos_plugin.driver_manager, 'driver')
|
||||
mock_manager.reset_mock()
|
||||
|
||||
fields = base_object.get_updatable_fields(
|
||||
fields = obj_utils.get_updatable_fields(
|
||||
policy_object.QosPolicy, self.policy_data['policy'])
|
||||
self.qos_plugin.update_policy(
|
||||
self.ctxt, self.policy.id, {'policy': fields})
|
||||
|
|
Loading…
Reference in New Issue