)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"c1d0c34bf1b08bfb50d2e38c71838f3e4942c096","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Add test for Neutron object versions"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Adds a test to Neutron to check object versions for any changes"},{"line_number":10,"context_line":"to obejcts. It prompts the develper to update the version of the"},{"line_number":11,"context_line":"changed object. It uses oslo.versionedobjects."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Change-Id: I99454b28ae0b5fa663354eeccdf709d4030a280b"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"3a7e1126_cee37c04","line":10,"updated":"2015-12-17 15:27:04.000000000","message":"objects, developer","commit_id":"93fb84b4fa3e194acfaceb6444434eb29085a5f3"},{"author":{"_account_id":9551,"name":"Martin Hickey","email":"martin.hickey@ie.ibm.com","username":"mhickey"},"change_message_id":"06941e80cf4890f8ec0cff1e44df857240386db9","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Add test for Neutron object versions"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Adds a test to Neutron to check object versions for any changes"},{"line_number":10,"context_line":"to obejcts. It prompts the develper to update the version of the"},{"line_number":11,"context_line":"changed object. It uses oslo.versionedobjects."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Change-Id: I99454b28ae0b5fa663354eeccdf709d4030a280b"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"3a7e1126_4b708c0b","line":10,"in_reply_to":"3a7e1126_cee37c04","updated":"2015-12-18 21:17:48.000000000","message":"Updated.","commit_id":"93fb84b4fa3e194acfaceb6444434eb29085a5f3"}],"neutron/objects/base.py":[{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"c1d0c34bf1b08bfb50d2e38c71838f3e4942c096","unresolved":false,"context_lines":[{"line_number":49,"context_line":""},{"line_number":50,"context_line":"class NeutronObjectRegistry(obj_base.VersionedObjectRegistry):"},{"line_number":51,"context_line":"    def registration_hook(self, cls, index):"},{"line_number":52,"context_line":"        setattr(objects, cls.obj_name(), cls)"},{"line_number":53,"context_line":""},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"@six.add_metaclass(abc.ABCMeta)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a7e1126_21649120","line":52,"updated":"2015-12-17 15:27:04.000000000","message":"Not sure I understand why we need to set those attributes on neutron.objects module. Doesn\u0027t it work without it? Or is it some type of convenience thing from nova? If so, it belongs to a separate patch with proper justification.\n\nIf that is indeed not needed, I guess there is no big need in NeutronObjectRegistry so far.","commit_id":"93fb84b4fa3e194acfaceb6444434eb29085a5f3"},{"author":{"_account_id":9551,"name":"Martin Hickey","email":"martin.hickey@ie.ibm.com","username":"mhickey"},"change_message_id":"06941e80cf4890f8ec0cff1e44df857240386db9","unresolved":false,"context_lines":[{"line_number":49,"context_line":""},{"line_number":50,"context_line":"class NeutronObjectRegistry(obj_base.VersionedObjectRegistry):"},{"line_number":51,"context_line":"    def registration_hook(self, cls, index):"},{"line_number":52,"context_line":"        setattr(objects, cls.obj_name(), cls)"},{"line_number":53,"context_line":""},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"@six.add_metaclass(abc.ABCMeta)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a7e1126_78f99cc6","line":52,"in_reply_to":"3a7e1126_21649120","updated":"2015-12-18 21:17:48.000000000","message":"I agree the override of the class is unnecessary. I copied it from Cinder in case we needed to overide it later like Cinder did. I will take it out","commit_id":"93fb84b4fa3e194acfaceb6444434eb29085a5f3"}],"neutron/tests/unit/api/rpc/handlers/test_resources_rpc.py":[{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"c1d0c34bf1b08bfb50d2e38c71838f3e4942c096","unresolved":false,"context_lines":[{"line_number":37,"context_line":"    return resource"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"@objects_base.NeutronObjectRegistry.register"},{"line_number":41,"context_line":"class FakeResource(objects_base.NeutronObject):"},{"line_number":42,"context_line":"    # Version 1.0: Initial version"},{"line_number":43,"context_line":"    VERSION \u003d \u00271.0\u0027"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a7e1126_2e4b2089","line":40,"updated":"2015-12-17 15:27:04.000000000","message":"should it also be register_if(False)? Not sure I completely understand the intent of it though. Can you clarify?","commit_id":"93fb84b4fa3e194acfaceb6444434eb29085a5f3"},{"author":{"_account_id":9551,"name":"Martin Hickey","email":"martin.hickey@ie.ibm.com","username":"mhickey"},"change_message_id":"06941e80cf4890f8ec0cff1e44df857240386db9","unresolved":false,"context_lines":[{"line_number":37,"context_line":"    return resource"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"@objects_base.NeutronObjectRegistry.register"},{"line_number":41,"context_line":"class FakeResource(objects_base.NeutronObject):"},{"line_number":42,"context_line":"    # Version 1.0: Initial version"},{"line_number":43,"context_line":"    VERSION \u003d \u00271.0\u0027"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a7e1126_184ad855","line":40,"in_reply_to":"3a7e1126_2e4b2089","updated":"2015-12-18 21:17:48.000000000","message":"It is somehow usd by the unit tests. Here are the errors if I disable it using  register_if(False): http://paste.openstack.org/show/482324/","commit_id":"93fb84b4fa3e194acfaceb6444434eb29085a5f3"},{"author":{"_account_id":11803,"name":"Ryan Rossiter","email":"rlrossit@us.ibm.com","username":"rlrossiter"},"change_message_id":"0651994aa7119054774b1fb3c3bc75d0b0743723","unresolved":false,"context_lines":[{"line_number":38,"context_line":"    return resource"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"@obj_base.VersionedObjectRegistry.register"},{"line_number":42,"context_line":"class FakeResource(objects_base.NeutronObject):"},{"line_number":43,"context_line":"    # Version 1.0: Initial version"},{"line_number":44,"context_line":"    VERSION \u003d \u00271.0\u0027"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa69d971_6d2fb4f6","line":41,"updated":"2016-01-04 21:24:36.000000000","message":"Alright so I got this figured out. Don\u0027t do the register here because this will register it with the global registry, where you want to do the registration locally with obj_base.VersionedObjectRegistry.register(FakeResource).","commit_id":"856cc5c5b68db56b1dd0689a14430e1cdf07c9bf"},{"author":{"_account_id":9551,"name":"Martin Hickey","email":"martin.hickey@ie.ibm.com","username":"mhickey"},"change_message_id":"15a9afea93a326b53045cbf6b23721cf6446f19e","unresolved":false,"context_lines":[{"line_number":38,"context_line":"    return resource"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"@obj_base.VersionedObjectRegistry.register"},{"line_number":42,"context_line":"class FakeResource(objects_base.NeutronObject):"},{"line_number":43,"context_line":"    # Version 1.0: Initial version"},{"line_number":44,"context_line":"    VERSION \u003d \u00271.0\u0027"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa69d971_af7028dd","line":41,"in_reply_to":"fa69d971_6d2fb4f6","updated":"2016-01-05 11:53:24.000000000","message":"ok, sure.","commit_id":"856cc5c5b68db56b1dd0689a14430e1cdf07c9bf"},{"author":{"_account_id":11803,"name":"Ryan Rossiter","email":"rlrossit@us.ibm.com","username":"rlrossiter"},"change_message_id":"0651994aa7119054774b1fb3c3bc75d0b0743723","unresolved":false,"context_lines":[{"line_number":93,"context_line":"class ResourcesPullRpcApiTestCase(ResourcesRpcBaseTestCase):"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"    def setUp(self):"},{"line_number":96,"context_line":"        super(ResourcesPullRpcApiTestCase, self).setUp()"},{"line_number":97,"context_line":"        mock.patch.object(resources_rpc, \u0027_validate_resource_type\u0027).start()"},{"line_number":98,"context_line":"        mock.patch(\u0027neutron.api.rpc.callbacks.resources.get_resource_cls\u0027,"},{"line_number":99,"context_line":"                   return_value\u003dFakeResource).start()"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa69d971_482c1e02","line":96,"updated":"2016-01-04 21:24:36.000000000","message":"Then you can register the class down here, and it will work now!","commit_id":"856cc5c5b68db56b1dd0689a14430e1cdf07c9bf"},{"author":{"_account_id":9551,"name":"Martin Hickey","email":"martin.hickey@ie.ibm.com","username":"mhickey"},"change_message_id":"15a9afea93a326b53045cbf6b23721cf6446f19e","unresolved":false,"context_lines":[{"line_number":93,"context_line":"class ResourcesPullRpcApiTestCase(ResourcesRpcBaseTestCase):"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"    def setUp(self):"},{"line_number":96,"context_line":"        super(ResourcesPullRpcApiTestCase, self).setUp()"},{"line_number":97,"context_line":"        mock.patch.object(resources_rpc, \u0027_validate_resource_type\u0027).start()"},{"line_number":98,"context_line":"        mock.patch(\u0027neutron.api.rpc.callbacks.resources.get_resource_cls\u0027,"},{"line_number":99,"context_line":"                   return_value\u003dFakeResource).start()"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa69d971_529913c3","line":96,"in_reply_to":"fa69d971_482c1e02","updated":"2016-01-05 11:53:24.000000000","message":"As you have suggested, class can be registered in the test_pull() method and ResourcesPullRpcCallbackTestCase::setUp() and ResourcesPullRpcCallbackTestCase::test_push().","commit_id":"856cc5c5b68db56b1dd0689a14430e1cdf07c9bf"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"6380fbe578b11f0137093fe2941c98fc46a71019","unresolved":false,"context_lines":[{"line_number":96,"context_line":"        super(ResourcesPullRpcApiTestCase, self).setUp()"},{"line_number":97,"context_line":"        mock.patch.object(resources_rpc, \u0027_validate_resource_type\u0027).start()"},{"line_number":98,"context_line":"        mock.patch(\u0027neutron.api.rpc.callbacks.resources.get_resource_cls\u0027,"},{"line_number":99,"context_line":"                   return_value\u003dFakeResource).start()"},{"line_number":100,"context_line":"        self.rpc \u003d resources_rpc.ResourcesPullRpcApi()"},{"line_number":101,"context_line":"        mock.patch.object(self.rpc, \u0027client\u0027).start()"},{"line_number":102,"context_line":"        self.cctxt_mock \u003d self.rpc.client.prepare.return_value"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a7b0d38_b1801848","line":99,"updated":"2015-12-22 15:20:10.000000000","message":"This is probably what\u0027s causing your failures http://paste.openstack.org/show/482324/ - because it\u0027s expecting to get FakeResource from the registry. I\u0027m not sure how to avoid that, Dan Smith is the guy you\u0027d want to talk to probably, or Ryan Rossiter, but they are both on vacation until thew new year.","commit_id":"856cc5c5b68db56b1dd0689a14430e1cdf07c9bf"},{"author":{"_account_id":11803,"name":"Ryan Rossiter","email":"rlrossit@us.ibm.com","username":"rlrossiter"},"change_message_id":"e0fc7d293609e1ec671fa049ba253ff1e719cc4d","unresolved":false,"context_lines":[{"line_number":96,"context_line":"        super(ResourcesPullRpcApiTestCase, self).setUp()"},{"line_number":97,"context_line":"        mock.patch.object(resources_rpc, \u0027_validate_resource_type\u0027).start()"},{"line_number":98,"context_line":"        mock.patch(\u0027neutron.api.rpc.callbacks.resources.get_resource_cls\u0027,"},{"line_number":99,"context_line":"                   return_value\u003dFakeResource).start()"},{"line_number":100,"context_line":"        self.rpc \u003d resources_rpc.ResourcesPullRpcApi()"},{"line_number":101,"context_line":"        mock.patch.object(self.rpc, \u0027client\u0027).start()"},{"line_number":102,"context_line":"        self.cctxt_mock \u003d self.rpc.client.prepare.return_value"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa69d971_da59c65b","line":99,"in_reply_to":"1a7b0d38_b1801848","updated":"2016-01-04 15:43:11.000000000","message":"This is quite the conundrum. It looks like since pull() is doing an obj_from_primitive(), which requires a class lookup on the name, it does have to be in the registry. You can use the temp registry pattern where you just save it off in setup, register your class locally, and then reset the old registry after the test.\n\nThat does make me curious though... if we call FakeResource.obj_from_primitive(primitive, context), why do we need to look up in the primitive to see what class we\u0027re calling obj_from_primitive() on? Can\u0027t we just get that info from cls? That way we don\u0027t require the registry lookup.","commit_id":"856cc5c5b68db56b1dd0689a14430e1cdf07c9bf"},{"author":{"_account_id":9551,"name":"Martin Hickey","email":"martin.hickey@ie.ibm.com","username":"mhickey"},"change_message_id":"15a9afea93a326b53045cbf6b23721cf6446f19e","unresolved":false,"context_lines":[{"line_number":96,"context_line":"        super(ResourcesPullRpcApiTestCase, self).setUp()"},{"line_number":97,"context_line":"        mock.patch.object(resources_rpc, \u0027_validate_resource_type\u0027).start()"},{"line_number":98,"context_line":"        mock.patch(\u0027neutron.api.rpc.callbacks.resources.get_resource_cls\u0027,"},{"line_number":99,"context_line":"                   return_value\u003dFakeResource).start()"},{"line_number":100,"context_line":"        self.rpc \u003d resources_rpc.ResourcesPullRpcApi()"},{"line_number":101,"context_line":"        mock.patch.object(self.rpc, \u0027client\u0027).start()"},{"line_number":102,"context_line":"        self.cctxt_mock \u003d self.rpc.client.prepare.return_value"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa69d971_32301fe8","line":99,"in_reply_to":"fa69d971_da59c65b","updated":"2016-01-05 11:53:24.000000000","message":"Using the temp registry pattern.","commit_id":"856cc5c5b68db56b1dd0689a14430e1cdf07c9bf"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"52efce8954c7ead4f79535e758359c84a7dc1a5d","unresolved":false,"context_lines":[{"line_number":13,"context_line":"# See the License for the specific language governing permissions and"},{"line_number":14,"context_line":"# limitations under the License."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"import copy"},{"line_number":17,"context_line":"import mock"},{"line_number":18,"context_line":"from oslo_versionedobjects import base as obj_base"},{"line_number":19,"context_line":"from oslo_versionedobjects import fields as obj_fields"}],"source_content_type":"text/x-python","patch_set":4,"id":"fa69d971_799d1a09","line":16,"updated":"2016-01-05 14:23:04.000000000","message":"nit: could have a newline to split stdlib from 3party libs.","commit_id":"e5274c519fbf1b849211e795829bd4dccfcc40ec"},{"author":{"_account_id":9551,"name":"Martin Hickey","email":"martin.hickey@ie.ibm.com","username":"mhickey"},"change_message_id":"86d676e63238b60f3a25ad0675b6b8c78068033b","unresolved":false,"context_lines":[{"line_number":13,"context_line":"# See the License for the specific language governing permissions and"},{"line_number":14,"context_line":"# limitations under the License."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"import copy"},{"line_number":17,"context_line":"import mock"},{"line_number":18,"context_line":"from oslo_versionedobjects import base as obj_base"},{"line_number":19,"context_line":"from oslo_versionedobjects import fields as obj_fields"}],"source_content_type":"text/x-python","patch_set":4,"id":"fa69d971_804ac324","line":16,"in_reply_to":"fa69d971_799d1a09","updated":"2016-01-05 17:00:36.000000000","message":"Done.","commit_id":"e5274c519fbf1b849211e795829bd4dccfcc40ec"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"52efce8954c7ead4f79535e758359c84a7dc1a5d","unresolved":false,"context_lines":[{"line_number":58,"context_line":"    def setUp(self):"},{"line_number":59,"context_line":"        super(ResourcesRpcBaseTestCase, self).setUp()"},{"line_number":60,"context_line":"        self._base_test_backup \u003d copy.copy("},{"line_number":61,"context_line":"            obj_base.VersionedObjectRegistry._registry._obj_classes)"},{"line_number":62,"context_line":"        self.addCleanup(self._restore_obj_registry)"},{"line_number":63,"context_line":"        self.context \u003d context.get_admin_context()"},{"line_number":64,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"fa69d971_b965d21e","line":61,"updated":"2016-01-05 14:23:04.000000000","message":"So here, we access internal elements of oslo.versionedobjects. Any later change in the library may break us. Should we have a supported fixture for that from the library itself? Alternatively, .unregister method in the library would do.","commit_id":"e5274c519fbf1b849211e795829bd4dccfcc40ec"},{"author":{"_account_id":9551,"name":"Martin Hickey","email":"martin.hickey@ie.ibm.com","username":"mhickey"},"change_message_id":"86d676e63238b60f3a25ad0675b6b8c78068033b","unresolved":false,"context_lines":[{"line_number":58,"context_line":"    def setUp(self):"},{"line_number":59,"context_line":"        super(ResourcesRpcBaseTestCase, self).setUp()"},{"line_number":60,"context_line":"        self._base_test_backup \u003d copy.copy("},{"line_number":61,"context_line":"            obj_base.VersionedObjectRegistry._registry._obj_classes)"},{"line_number":62,"context_line":"        self.addCleanup(self._restore_obj_registry)"},{"line_number":63,"context_line":"        self.context \u003d context.get_admin_context()"},{"line_number":64,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"fa69d971_e0061fcd","line":61,"in_reply_to":"fa69d971_b965d21e","updated":"2016-01-05 17:00:36.000000000","message":"Patch https://review.openstack.org/#/c/263800/ created. TODO comments added.","commit_id":"e5274c519fbf1b849211e795829bd4dccfcc40ec"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"69c5d5c13b4cfc3d9fc285629fea5794fcdfd51d","unresolved":false,"context_lines":[{"line_number":59,"context_line":"    def setUp(self):"},{"line_number":60,"context_line":"        super(ResourcesRpcBaseTestCase, self).setUp()"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"        # TODO(mhickey) This is using temp registry pattern where"},{"line_number":63,"context_line":"        # can backup the object registry, register a class locally, "},{"line_number":64,"context_line":"        # and then restore the original registry. "},{"line_number":65,"context_line":"        # Patch https://review.openstack.org/#/c/263800/ is patch"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa69d971_d3641723","line":62,"updated":"2016-01-05 17:27:08.000000000","message":"\u0027where can backup\u0027 does not parse","commit_id":"543e14e0e82d853b1d30fdf6b61e59a16f65eebf"},{"author":{"_account_id":9551,"name":"Martin Hickey","email":"martin.hickey@ie.ibm.com","username":"mhickey"},"change_message_id":"dffe277766152c9af666d08a8c8d675944729736","unresolved":false,"context_lines":[{"line_number":59,"context_line":"    def setUp(self):"},{"line_number":60,"context_line":"        super(ResourcesRpcBaseTestCase, self).setUp()"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"        # TODO(mhickey) This is using temp registry pattern where"},{"line_number":63,"context_line":"        # can backup the object registry, register a class locally, "},{"line_number":64,"context_line":"        # and then restore the original registry. "},{"line_number":65,"context_line":"        # Patch https://review.openstack.org/#/c/263800/ is patch"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa69d971_1f2a9490","line":62,"in_reply_to":"fa69d971_d3641723","updated":"2016-01-06 10:41:42.000000000","message":"Agreed, quite unclear!:) Updated to read better.","commit_id":"543e14e0e82d853b1d30fdf6b61e59a16f65eebf"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"69c5d5c13b4cfc3d9fc285629fea5794fcdfd51d","unresolved":false,"context_lines":[{"line_number":61,"context_line":""},{"line_number":62,"context_line":"        # TODO(mhickey) This is using temp registry pattern where"},{"line_number":63,"context_line":"        # can backup the object registry, register a class locally, "},{"line_number":64,"context_line":"        # and then restore the original registry. "},{"line_number":65,"context_line":"        # Patch https://review.openstack.org/#/c/263800/ is patch"},{"line_number":66,"context_line":"        # to encapsulate the internals into backup_registry method."},{"line_number":67,"context_line":"        # This code should be updated when the patch is merged. "}],"source_content_type":"text/x-python","patch_set":5,"id":"fa69d971_33f7b35a","line":64,"updated":"2016-01-05 17:27:08.000000000","message":"red thingies","commit_id":"543e14e0e82d853b1d30fdf6b61e59a16f65eebf"},{"author":{"_account_id":9551,"name":"Martin Hickey","email":"martin.hickey@ie.ibm.com","username":"mhickey"},"change_message_id":"dffe277766152c9af666d08a8c8d675944729736","unresolved":false,"context_lines":[{"line_number":61,"context_line":""},{"line_number":62,"context_line":"        # TODO(mhickey) This is using temp registry pattern where"},{"line_number":63,"context_line":"        # can backup the object registry, register a class locally, "},{"line_number":64,"context_line":"        # and then restore the original registry. "},{"line_number":65,"context_line":"        # Patch https://review.openstack.org/#/c/263800/ is patch"},{"line_number":66,"context_line":"        # to encapsulate the internals into backup_registry method."},{"line_number":67,"context_line":"        # This code should be updated when the patch is merged. "}],"source_content_type":"text/x-python","patch_set":5,"id":"fa69d971_df1e3c6f","line":64,"in_reply_to":"fa69d971_33f7b35a","updated":"2016-01-06 10:41:42.000000000","message":"Removed.","commit_id":"543e14e0e82d853b1d30fdf6b61e59a16f65eebf"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"69c5d5c13b4cfc3d9fc285629fea5794fcdfd51d","unresolved":false,"context_lines":[{"line_number":63,"context_line":"        # can backup the object registry, register a class locally, "},{"line_number":64,"context_line":"        # and then restore the original registry. "},{"line_number":65,"context_line":"        # Patch https://review.openstack.org/#/c/263800/ is patch"},{"line_number":66,"context_line":"        # to encapsulate the internals into backup_registry method."},{"line_number":67,"context_line":"        # This code should be updated when the patch is merged. "},{"line_number":68,"context_line":"        self._base_test_backup \u003d copy.copy("},{"line_number":69,"context_line":"            obj_base.VersionedObjectRegistry._registry._obj_classes)"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa69d971_d3bdf768","line":66,"updated":"2016-01-05 17:27:08.000000000","message":"Let\u0027s not give too much details about solution, a link is enough.","commit_id":"543e14e0e82d853b1d30fdf6b61e59a16f65eebf"},{"author":{"_account_id":9551,"name":"Martin Hickey","email":"martin.hickey@ie.ibm.com","username":"mhickey"},"change_message_id":"dffe277766152c9af666d08a8c8d675944729736","unresolved":false,"context_lines":[{"line_number":63,"context_line":"        # can backup the object registry, register a class locally, "},{"line_number":64,"context_line":"        # and then restore the original registry. "},{"line_number":65,"context_line":"        # Patch https://review.openstack.org/#/c/263800/ is patch"},{"line_number":66,"context_line":"        # to encapsulate the internals into backup_registry method."},{"line_number":67,"context_line":"        # This code should be updated when the patch is merged. "},{"line_number":68,"context_line":"        self._base_test_backup \u003d copy.copy("},{"line_number":69,"context_line":"            obj_base.VersionedObjectRegistry._registry._obj_classes)"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa69d971_6240d334","line":66,"in_reply_to":"fa69d971_d3bdf768","updated":"2016-01-06 10:41:42.000000000","message":"Ok, simplified to patch reference.","commit_id":"543e14e0e82d853b1d30fdf6b61e59a16f65eebf"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"69c5d5c13b4cfc3d9fc285629fea5794fcdfd51d","unresolved":false,"context_lines":[{"line_number":72,"context_line":"        self.context \u003d context.get_admin_context()"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"    def _restore_obj_registry(self):"},{"line_number":75,"context_line":"        # TODO(mhickey) This is using temp registry pattern where"},{"line_number":76,"context_line":"        # can backup the object registry, register a class locally, "},{"line_number":77,"context_line":"        # and then restore the original registry. "},{"line_number":78,"context_line":"        # Patch https://review.openstack.org/#/c/263800/ is patch"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa69d971_73af6b2a","line":75,"updated":"2016-01-05 17:27:08.000000000","message":"one todo is enough","commit_id":"543e14e0e82d853b1d30fdf6b61e59a16f65eebf"},{"author":{"_account_id":9551,"name":"Martin Hickey","email":"martin.hickey@ie.ibm.com","username":"mhickey"},"change_message_id":"dffe277766152c9af666d08a8c8d675944729736","unresolved":false,"context_lines":[{"line_number":72,"context_line":"        self.context \u003d context.get_admin_context()"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"    def _restore_obj_registry(self):"},{"line_number":75,"context_line":"        # TODO(mhickey) This is using temp registry pattern where"},{"line_number":76,"context_line":"        # can backup the object registry, register a class locally, "},{"line_number":77,"context_line":"        # and then restore the original registry. "},{"line_number":78,"context_line":"        # Patch https://review.openstack.org/#/c/263800/ is patch"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa69d971_827b877a","line":75,"in_reply_to":"fa69d971_73af6b2a","updated":"2016-01-06 10:41:42.000000000","message":"ok, removed this todo.","commit_id":"543e14e0e82d853b1d30fdf6b61e59a16f65eebf"}],"neutron/tests/unit/objects/test_base.py":[{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"7655a51892f37cf00725daf08736394021d0be95","unresolved":false,"context_lines":[{"line_number":36,"context_line":"        pass"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"@obj_base.VersionedObjectRegistry.register_if(False)"},{"line_number":40,"context_line":"class FakeNeutronObject(base.NeutronDbObject):"},{"line_number":41,"context_line":"    # Version 1.0: Initial version"},{"line_number":42,"context_line":"    VERSION \u003d \u00271.0\u0027"}],"source_content_type":"text/x-python","patch_set":3,"id":"3a7e1126_8d63ac41","line":39,"updated":"2015-12-21 17:41:26.000000000","message":"why do we need register_if here?","commit_id":"856cc5c5b68db56b1dd0689a14430e1cdf07c9bf"},{"author":{"_account_id":11803,"name":"Ryan Rossiter","email":"rlrossit@us.ibm.com","username":"rlrossiter"},"change_message_id":"e0fc7d293609e1ec671fa049ba253ff1e719cc4d","unresolved":false,"context_lines":[{"line_number":36,"context_line":"        pass"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"@obj_base.VersionedObjectRegistry.register_if(False)"},{"line_number":40,"context_line":"class FakeNeutronObject(base.NeutronDbObject):"},{"line_number":41,"context_line":"    # Version 1.0: Initial version"},{"line_number":42,"context_line":"    VERSION \u003d \u00271.0\u0027"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa69d971_69d25ad4","line":39,"in_reply_to":"1a7b0d38_4e2593c0","updated":"2016-01-04 15:43:11.000000000","message":"the register_if(False) is to allow oslo.versionedobjects to handle a large portion of private class inheritance/handling (https://github.com/openstack/oslo.versionedobjects/blob/master/oslo_versionedobjects/base.py#L46-L96) without forcing this fake test object into the object registry (which would force you to keep a version hash for the fingerprint testing).","commit_id":"856cc5c5b68db56b1dd0689a14430e1cdf07c9bf"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"6380fbe578b11f0137093fe2941c98fc46a71019","unresolved":false,"context_lines":[{"line_number":36,"context_line":"        pass"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"@obj_base.VersionedObjectRegistry.register_if(False)"},{"line_number":40,"context_line":"class FakeNeutronObject(base.NeutronDbObject):"},{"line_number":41,"context_line":"    # Version 1.0: Initial version"},{"line_number":42,"context_line":"    VERSION \u003d \u00271.0\u0027"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a7b0d38_4e2593c0","line":39,"in_reply_to":"3a7e1126_8d63ac41","updated":"2015-12-22 15:20:10.000000000","message":"We did the same in cinder:\n\nhttps://review.openstack.org/#/c/243826/4/cinder/tests/unit/objects/test_base.py\n\nBut in that case, TestObject was only used in that module (by TestCinderObject which is not registered).\n\nIf FakeResource is used globally that might be tricky, although I think you can register objects in a test, but you have to make sure that the base test class is saving off the registry and restoring it before and after each test run, like this:\n\nhttps://review.openstack.org/#/c/243826/4/cinder/test.py","commit_id":"856cc5c5b68db56b1dd0689a14430e1cdf07c9bf"},{"author":{"_account_id":9551,"name":"Martin Hickey","email":"martin.hickey@ie.ibm.com","username":"mhickey"},"change_message_id":"15a9afea93a326b53045cbf6b23721cf6446f19e","unresolved":false,"context_lines":[{"line_number":36,"context_line":"        pass"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"@obj_base.VersionedObjectRegistry.register_if(False)"},{"line_number":40,"context_line":"class FakeNeutronObject(base.NeutronDbObject):"},{"line_number":41,"context_line":"    # Version 1.0: Initial version"},{"line_number":42,"context_line":"    VERSION \u003d \u00271.0\u0027"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa69d971_f2d7e748","line":39,"in_reply_to":"fa69d971_69d25ad4","updated":"2016-01-05 11:53:24.000000000","message":"Good explanation Ryan, thanks.","commit_id":"856cc5c5b68db56b1dd0689a14430e1cdf07c9bf"}],"neutron/tests/unit/objects/test_objects.py":[{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"c1d0c34bf1b08bfb50d2e38c71838f3e4942c096","unresolved":false,"context_lines":[{"line_number":27,"context_line":"    \u0027QosBandwidthLimitRule\u0027: \u00271.0-4e44a8f5c2895ab1278399f87b40a13d\u0027,"},{"line_number":28,"context_line":"    \u0027QosRuleType\u0027: \u00271.0-d0df298d49eeffab91af18d1a4cf7eaf\u0027,"},{"line_number":29,"context_line":"    \u0027QosPolicy\u0027: \u00271.0-721fa60ea8f0e8f15d456d6e917dfe59\u0027,"},{"line_number":30,"context_line":"    \u0027FakeResource\u0027: \u00271.0-33623cf5afb7f4e1ba3d16e4fe00e495\u0027,"},{"line_number":31,"context_line":"}"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"3a7e1126_41ed1d24","line":30,"updated":"2015-12-17 15:27:04.000000000","message":"...yeah, I guess it should be skipped here since it\u0027s not a production object.","commit_id":"93fb84b4fa3e194acfaceb6444434eb29085a5f3"},{"author":{"_account_id":9551,"name":"Martin Hickey","email":"martin.hickey@ie.ibm.com","username":"mhickey"},"change_message_id":"06941e80cf4890f8ec0cff1e44df857240386db9","unresolved":false,"context_lines":[{"line_number":27,"context_line":"    \u0027QosBandwidthLimitRule\u0027: \u00271.0-4e44a8f5c2895ab1278399f87b40a13d\u0027,"},{"line_number":28,"context_line":"    \u0027QosRuleType\u0027: \u00271.0-d0df298d49eeffab91af18d1a4cf7eaf\u0027,"},{"line_number":29,"context_line":"    \u0027QosPolicy\u0027: \u00271.0-721fa60ea8f0e8f15d456d6e917dfe59\u0027,"},{"line_number":30,"context_line":"    \u0027FakeResource\u0027: \u00271.0-33623cf5afb7f4e1ba3d16e4fe00e495\u0027,"},{"line_number":31,"context_line":"}"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"3a7e1126_b5706ddd","line":30,"in_reply_to":"3a7e1126_41ed1d24","updated":"2015-12-18 21:17:48.000000000","message":"Looks like its needed by the unit tests.","commit_id":"93fb84b4fa3e194acfaceb6444434eb29085a5f3"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"c1d0c34bf1b08bfb50d2e38c71838f3e4942c096","unresolved":false,"context_lines":[{"line_number":38,"context_line":"            base.NeutronObjectRegistry.obj_classes())"},{"line_number":39,"context_line":"        fingerprints \u003d checker.get_hashes()"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"        if os.getenv(\u0027GENERATE_HASHES\u0027):"},{"line_number":42,"context_line":"            file(\u0027object_hashes.txt\u0027, \u0027w\u0027).write("},{"line_number":43,"context_line":"                pprint.pformat(fingerprints))"},{"line_number":44,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"3a7e1126_01863513","line":41,"updated":"2015-12-17 15:27:04.000000000","message":"My understanding is that it can be used for developer convenience to generate a new hash after bumping a version. If so, should we then mention the variable in passenv in tox.ini for unittest job so that it\u0027s possible to enable it for the target? (Note that tox since 2.0 does not pass all envvars into targets, only those mentioned under passenv).\n\nWe should probably also document the thing somewhere, but it\u0027s not for this patch since we lack general objects devref in the tree yet.","commit_id":"93fb84b4fa3e194acfaceb6444434eb29085a5f3"},{"author":{"_account_id":9551,"name":"Martin Hickey","email":"martin.hickey@ie.ibm.com","username":"mhickey"},"change_message_id":"06941e80cf4890f8ec0cff1e44df857240386db9","unresolved":false,"context_lines":[{"line_number":38,"context_line":"            base.NeutronObjectRegistry.obj_classes())"},{"line_number":39,"context_line":"        fingerprints \u003d checker.get_hashes()"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"        if os.getenv(\u0027GENERATE_HASHES\u0027):"},{"line_number":42,"context_line":"            file(\u0027object_hashes.txt\u0027, \u0027w\u0027).write("},{"line_number":43,"context_line":"                pprint.pformat(fingerprints))"},{"line_number":44,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"3a7e1126_35a6bd53","line":41,"in_reply_to":"3a7e1126_01863513","updated":"2015-12-18 21:17:48.000000000","message":"Added as passenv to tox.ini.","commit_id":"93fb84b4fa3e194acfaceb6444434eb29085a5f3"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"6380fbe578b11f0137093fe2941c98fc46a71019","unresolved":false,"context_lines":[{"line_number":16,"context_line":"import pprint"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"from oslo_versionedobjects import base as obj_base"},{"line_number":19,"context_line":"from oslo_versionedobjects import fixture"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"from neutron.tests import base as test_base"},{"line_number":22,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"1a7b0d38_aeec3790","line":19,"updated":"2015-12-22 15:20:10.000000000","message":"Where are you importing this from?\n\nIn cinder we have to get it via extras:\n\nhttps://review.openstack.org/#/c/243826/4/tox.ini","commit_id":"856cc5c5b68db56b1dd0689a14430e1cdf07c9bf"},{"author":{"_account_id":11803,"name":"Ryan Rossiter","email":"rlrossit@us.ibm.com","username":"rlrossiter"},"change_message_id":"0651994aa7119054774b1fb3c3bc75d0b0743723","unresolved":false,"context_lines":[{"line_number":16,"context_line":"import pprint"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"from oslo_versionedobjects import base as obj_base"},{"line_number":19,"context_line":"from oslo_versionedobjects import fixture"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"from neutron.tests import base as test_base"},{"line_number":22,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"fa69d971_6d2a5480","line":19,"in_reply_to":"1a7b0d38_aeec3790","updated":"2016-01-04 21:24:36.000000000","message":"That is an excellent question. Is it because it finally got merged? https://review.openstack.org/#/c/238871/","commit_id":"856cc5c5b68db56b1dd0689a14430e1cdf07c9bf"},{"author":{"_account_id":9551,"name":"Martin Hickey","email":"martin.hickey@ie.ibm.com","username":"mhickey"},"change_message_id":"15a9afea93a326b53045cbf6b23721cf6446f19e","unresolved":false,"context_lines":[{"line_number":16,"context_line":"import pprint"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"from oslo_versionedobjects import base as obj_base"},{"line_number":19,"context_line":"from oslo_versionedobjects import fixture"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"from neutron.tests import base as test_base"},{"line_number":22,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"fa69d971_b212cf07","line":19,"in_reply_to":"fa69d971_6d2a5480","updated":"2016-01-05 11:53:24.000000000","message":"Had picked up the latest for the patch.","commit_id":"856cc5c5b68db56b1dd0689a14430e1cdf07c9bf"},{"author":{"_account_id":11803,"name":"Ryan Rossiter","email":"rlrossit@us.ibm.com","username":"rlrossiter"},"change_message_id":"0651994aa7119054774b1fb3c3bc75d0b0743723","unresolved":false,"context_lines":[{"line_number":27,"context_line":"    \u0027QosBandwidthLimitRule\u0027: \u00271.0-4e44a8f5c2895ab1278399f87b40a13d\u0027,"},{"line_number":28,"context_line":"    \u0027QosRuleType\u0027: \u00271.0-d0df298d49eeffab91af18d1a4cf7eaf\u0027,"},{"line_number":29,"context_line":"    \u0027QosPolicy\u0027: \u00271.0-721fa60ea8f0e8f15d456d6e917dfe59\u0027,"},{"line_number":30,"context_line":"    \u0027FakeResource\u0027: \u00271.0-33623cf5afb7f4e1ba3d16e4fe00e495\u0027,"},{"line_number":31,"context_line":"}"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"fa69d971_921b271b","line":30,"updated":"2016-01-04 21:24:36.000000000","message":"You really don\u0027t want to be tracking the object hashes of test objects. Use register_if(False) or use a temporary object registry if need be.","commit_id":"856cc5c5b68db56b1dd0689a14430e1cdf07c9bf"},{"author":{"_account_id":9551,"name":"Martin Hickey","email":"martin.hickey@ie.ibm.com","username":"mhickey"},"change_message_id":"15a9afea93a326b53045cbf6b23721cf6446f19e","unresolved":false,"context_lines":[{"line_number":27,"context_line":"    \u0027QosBandwidthLimitRule\u0027: \u00271.0-4e44a8f5c2895ab1278399f87b40a13d\u0027,"},{"line_number":28,"context_line":"    \u0027QosRuleType\u0027: \u00271.0-d0df298d49eeffab91af18d1a4cf7eaf\u0027,"},{"line_number":29,"context_line":"    \u0027QosPolicy\u0027: \u00271.0-721fa60ea8f0e8f15d456d6e917dfe59\u0027,"},{"line_number":30,"context_line":"    \u0027FakeResource\u0027: \u00271.0-33623cf5afb7f4e1ba3d16e4fe00e495\u0027,"},{"line_number":31,"context_line":"}"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"fa69d971_b2296f39","line":30,"in_reply_to":"fa69d971_921b271b","updated":"2016-01-05 11:53:24.000000000","message":"Sure, the temp registry pattern will allow this.","commit_id":"856cc5c5b68db56b1dd0689a14430e1cdf07c9bf"}],"tools/check_unit_test_structure.sh":[{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"c1d0c34bf1b08bfb50d2e38c71838f3e4942c096","unresolved":false,"context_lines":[{"line_number":14,"context_line":"    # The following vendor plugins are not required to confrm to the"},{"line_number":15,"context_line":"    # structural requirements."},{"line_number":16,"context_line":"    \"^plugins/ibm.*$\""},{"line_number":17,"context_line":"    # The following test is required for oslo.versionobject"},{"line_number":18,"context_line":"    \"^objects/test_objects.py$\""},{"line_number":19,"context_line":"    # The following open source plugin tests are not actually unit"},{"line_number":20,"context_line":"    # tests and are ignored pending their relocation to the functional"}],"source_content_type":"text/x-sh","patch_set":2,"id":"3a7e1126_8e02540a","line":17,"updated":"2015-12-17 15:27:04.000000000","message":"oslo.versionedobjects","commit_id":"93fb84b4fa3e194acfaceb6444434eb29085a5f3"},{"author":{"_account_id":9551,"name":"Martin Hickey","email":"martin.hickey@ie.ibm.com","username":"mhickey"},"change_message_id":"06941e80cf4890f8ec0cff1e44df857240386db9","unresolved":false,"context_lines":[{"line_number":14,"context_line":"    # The following vendor plugins are not required to confrm to the"},{"line_number":15,"context_line":"    # structural requirements."},{"line_number":16,"context_line":"    \"^plugins/ibm.*$\""},{"line_number":17,"context_line":"    # The following test is required for oslo.versionobject"},{"line_number":18,"context_line":"    \"^objects/test_objects.py$\""},{"line_number":19,"context_line":"    # The following open source plugin tests are not actually unit"},{"line_number":20,"context_line":"    # tests and are ignored pending their relocation to the functional"}],"source_content_type":"text/x-sh","patch_set":2,"id":"3a7e1126_35455db2","line":17,"in_reply_to":"3a7e1126_8e02540a","updated":"2015-12-18 21:17:48.000000000","message":"Updated.","commit_id":"93fb84b4fa3e194acfaceb6444434eb29085a5f3"}]}
