diff options
-rw-r--r-- | designate/objects/base.py | 6 | ||||
-rw-r--r-- | designate/tests/unit/objects/test_base.py | 15 | ||||
-rw-r--r-- | doc/source/install/install-obs.rst | 2 | ||||
-rw-r--r-- | doc/source/install/install-rdo.rst | 2 | ||||
-rw-r--r-- | doc/source/install/install-ubuntu.rst | 2 |
5 files changed, 22 insertions, 5 deletions
diff --git a/designate/objects/base.py b/designate/objects/base.py index de7fa822..2ed893c5 100644 --- a/designate/objects/base.py +++ b/designate/objects/base.py @@ -18,6 +18,8 @@ from oslo_versionedobjects import exception from oslo_utils import excutils from designate.i18n import _ from oslo_versionedobjects import base +from oslo_versionedobjects import fields as ovoo_fields + from oslo_versionedobjects.base import VersionedObjectDictCompat as DictObjectMixin # noqa from designate.objects import fields @@ -226,10 +228,10 @@ class DesignateObject(base.VersionedObject): continue # Reset straight Object and ListOfObjects fields - if isinstance(self.fields[field], self.obj_fields.ObjectField): + if isinstance(self.fields[field], ovoo_fields.ObjectField): value.obj_reset_changes(recursive=True) elif isinstance(self.fields[field], - self.obj_fields.ListOfObjectsField): + ovoo_fields.ListOfObjectsField): for thing in value: thing.obj_reset_changes(recursive=True) diff --git a/designate/tests/unit/objects/test_base.py b/designate/tests/unit/objects/test_base.py index 15b913d9..3b3fa23e 100644 --- a/designate/tests/unit/objects/test_base.py +++ b/designate/tests/unit/objects/test_base.py @@ -405,6 +405,21 @@ class DesignateObjectTest(oslotest.base.BaseTestCase): self.assertEqual(1, len(obj.obj_what_changed())) self.assertEqual({'name': "My Name"}, obj.obj_get_changes()) + def test_obj_reset_changes_recursive(self): + obj = TestObject() + obj.id = "My ID" + obj.name = "My Name" + obj.nested = TestObject() + obj.nested.id = "My ID" + + self.assertEqual(3, len(obj.obj_what_changed())) + + obj.obj_reset_changes() + self.assertEqual(1, len(obj.obj_what_changed())) + + obj.obj_reset_changes(recursive=True) + self.assertEqual(0, len(obj.obj_what_changed())) + def test_obj_get_original_value(self): # Create an object obj = TestObject() diff --git a/doc/source/install/install-obs.rst b/doc/source/install/install-obs.rst index bdfd906f..0f9fad35 100644 --- a/doc/source/install/install-obs.rst +++ b/doc/source/install/install-obs.rst @@ -86,9 +86,9 @@ Install and configure components [service:api] listen = 0.0.0.0:9001 auth_strategy = keystone - api_base_uri = http://controller:9001/ enable_api_v2 = True enable_api_admin = True + enable_host_header = True enabled_extensions_admin = quotas, reports * In the ``[keystone_authtoken]`` section, configure the following options: diff --git a/doc/source/install/install-rdo.rst b/doc/source/install/install-rdo.rst index a843c81e..c5dbf992 100644 --- a/doc/source/install/install-rdo.rst +++ b/doc/source/install/install-rdo.rst @@ -86,9 +86,9 @@ Install and configure components [service:api] listen = 0.0.0.0:9001 auth_strategy = keystone - api_base_uri = http://controller:9001/ enable_api_v2 = True enable_api_admin = True + enable_host_header = True enabled_extensions_admin = quotas, reports * In the ``[keystone_authtoken]`` section, configure the following options: diff --git a/doc/source/install/install-ubuntu.rst b/doc/source/install/install-ubuntu.rst index b35b52c0..4c4ebf7e 100644 --- a/doc/source/install/install-ubuntu.rst +++ b/doc/source/install/install-ubuntu.rst @@ -84,9 +84,9 @@ Install and configure components [service:api] listen = 0.0.0.0:9001 auth_strategy = keystone - api_base_uri = http://controller:9001/ enable_api_v2 = True enable_api_admin = True + enable_host_header = True enabled_extensions_admin = quotas, reports * In the ``[keystone_authtoken]`` section, configure the following options: |