)]}'
{"neutron/db/api.py":[{"author":{"_account_id":12444,"name":"John Schwarz","email":"jschwarz@redhat.com","username":"jschwarz"},"change_message_id":"5e6932b62d76c8c8ca3f5e0eda3a4fd34f881514","unresolved":false,"context_lines":[{"line_number":70,"context_line":""},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"# Common database operation implementations"},{"line_number":73,"context_line":"def get_object(context, model, id):"},{"line_number":74,"context_line":"    return (common_db_mixin.model_query(context, model)"},{"line_number":75,"context_line":"            .filter_by(id\u003did)"},{"line_number":76,"context_line":"            .one())"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba3cc151_3849b2b7","line":73,"updated":"2015-07-02 05:40:37.000000000","message":"This should be in a transaction.","commit_id":"03074e7001944c05f8b20d626cccdbf536165894"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"74332f8165285292faeaa54bf9af28c756b6c821","unresolved":false,"context_lines":[{"line_number":70,"context_line":""},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"# Common database operation implementations"},{"line_number":73,"context_line":"def get_object(context, model, id):"},{"line_number":74,"context_line":"    return (common_db_mixin.model_query(context, model)"},{"line_number":75,"context_line":"            .filter_by(id\u003did)"},{"line_number":76,"context_line":"            .one())"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba3cc151_3ed2fb5c","line":73,"in_reply_to":"ba3cc151_3849b2b7","updated":"2015-07-02 07:23:26.000000000","message":"Done","commit_id":"03074e7001944c05f8b20d626cccdbf536165894"},{"author":{"_account_id":12444,"name":"John Schwarz","email":"jschwarz@redhat.com","username":"jschwarz"},"change_message_id":"5e6932b62d76c8c8ca3f5e0eda3a4fd34f881514","unresolved":false,"context_lines":[{"line_number":74,"context_line":"    return (common_db_mixin.model_query(context, model)"},{"line_number":75,"context_line":"            .filter_by(id\u003did)"},{"line_number":76,"context_line":"            .one())"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"def create_object(context, model, values):"},{"line_number":80,"context_line":"    with context.session.begin(subtransactions\u003dTrue):"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba3cc151_f8cd8a31","line":77,"updated":"2015-07-02 05:40:37.000000000","message":"We talked about adding a new function here:\n\n def get_objects(context, model):\n    with context.session.begin(subtransactions\u003dTrue):\n        return common_db_mixin.model_query(context, model).all()","commit_id":"03074e7001944c05f8b20d626cccdbf536165894"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"74332f8165285292faeaa54bf9af28c756b6c821","unresolved":false,"context_lines":[{"line_number":74,"context_line":"    return (common_db_mixin.model_query(context, model)"},{"line_number":75,"context_line":"            .filter_by(id\u003did)"},{"line_number":76,"context_line":"            .one())"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"def create_object(context, model, values):"},{"line_number":80,"context_line":"    with context.session.begin(subtransactions\u003dTrue):"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba3cc151_7ebc0306","line":77,"in_reply_to":"ba3cc151_f8cd8a31","updated":"2015-07-02 07:23:26.000000000","message":"Done","commit_id":"03074e7001944c05f8b20d626cccdbf536165894"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"3842109b8f861bae554a0c4285cd7369b80798bb","unresolved":false,"context_lines":[{"line_number":91,"context_line":""},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"# Common database operation implementations"},{"line_number":94,"context_line":"def get_object(context, model, id):"},{"line_number":95,"context_line":"    with context.session.begin(subtransactions\u003dTrue):"},{"line_number":96,"context_line":"        return (common_db_mixin.model_query(context, model)"},{"line_number":97,"context_line":"                .filter_by(id\u003did)"}],"source_content_type":"text/x-python","patch_set":9,"id":"ba3cc151_b2b15a49","line":94,"updated":"2015-07-02 08:04:06.000000000","message":"Nit: Can we use \u0027obj_id\u0027 or something instead of \u0027id\u0027? \u0027id\u0027 is a reserved word in Python and I would like to avoid using it for a new code. A demerit is a name mismatch among dict key, db model field and a method argument.  It is just an opinion, so I am okay with the current version.","commit_id":"e90b28662eb769e26f2f6c202a71910819c3ff41"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"2e439550bdf2604ce55f8835aa64f8728169a094","unresolved":false,"context_lines":[{"line_number":91,"context_line":""},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"# Common database operation implementations"},{"line_number":94,"context_line":"def get_object(context, model, id):"},{"line_number":95,"context_line":"    with context.session.begin(subtransactions\u003dTrue):"},{"line_number":96,"context_line":"        return (common_db_mixin.model_query(context, model)"},{"line_number":97,"context_line":"                .filter_by(id\u003did)"}],"source_content_type":"text/x-python","patch_set":9,"id":"ba3cc151_52da4e4d","line":94,"in_reply_to":"ba3cc151_b2b15a49","updated":"2015-07-02 08:08:27.000000000","message":"I will fix it in follow-up. I made a note in private todo. :)","commit_id":"e90b28662eb769e26f2f6c202a71910819c3ff41"}],"neutron/db/qos/api.py":[{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"91d3d8e82287865add71d54787feaf9fd954cfca","unresolved":false,"context_lines":[{"line_number":41,"context_line":"        db_obj \u003d _get_policy(context, id)"},{"line_number":42,"context_line":"        db_obj.delete()"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"def _get_rule(context, id):"},{"line_number":45,"context_line":"    return (common_db_mixin.model_query(context, models.QosRule)"},{"line_number":46,"context_line":"            .filter_by(id\u003did)"},{"line_number":47,"context_line":"            .one())"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba3cc151_76e8fbe2","line":44,"updated":"2015-06-30 19:32:57.000000000","message":"nit: pep8 would require two empty lines between functions","commit_id":"d62ca6d3ad97acb85b7c7156101514a44343ea52"},{"author":{"_account_id":14605,"name":"vikram.choudhary","email":"vikschw@gmail.com","username":"vikram.choudhary"},"change_message_id":"cd03c8e841c13c25d7b87b8ea5f6cf734f611f35","unresolved":false,"context_lines":[{"line_number":41,"context_line":"        db_obj \u003d _get_policy(context, id)"},{"line_number":42,"context_line":"        db_obj.delete()"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"def _get_rule(context, id):"},{"line_number":45,"context_line":"    return (common_db_mixin.model_query(context, models.QosRule)"},{"line_number":46,"context_line":"            .filter_by(id\u003did)"},{"line_number":47,"context_line":"            .one())"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba3cc151_15ce305a","line":44,"in_reply_to":"ba3cc151_76e8fbe2","updated":"2015-07-01 06:57:16.000000000","message":"Will do it. Thanks.","commit_id":"d62ca6d3ad97acb85b7c7156101514a44343ea52"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"91d3d8e82287865add71d54787feaf9fd954cfca","unresolved":false,"context_lines":[{"line_number":62,"context_line":"        db_obj.save(session\u003dcontext.session)"},{"line_number":63,"context_line":"    return db_obj"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"def delete_rule(context, id):"},{"line_number":67,"context_line":"    with context.session.begin(subtransactions\u003dTrue):"},{"line_number":68,"context_line":"        db_obj \u003d _get_rule(context, id)"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba3cc151_168c0f34","line":65,"updated":"2015-06-30 19:32:57.000000000","message":"I find those so similar that maybe we want to have a common implementation for all of them that is only passed with model class as an argument to differentiate between them.","commit_id":"d62ca6d3ad97acb85b7c7156101514a44343ea52"},{"author":{"_account_id":14605,"name":"vikram.choudhary","email":"vikschw@gmail.com","username":"vikram.choudhary"},"change_message_id":"cd03c8e841c13c25d7b87b8ea5f6cf734f611f35","unresolved":false,"context_lines":[{"line_number":62,"context_line":"        db_obj.save(session\u003dcontext.session)"},{"line_number":63,"context_line":"    return db_obj"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"def delete_rule(context, id):"},{"line_number":67,"context_line":"    with context.session.begin(subtransactions\u003dTrue):"},{"line_number":68,"context_line":"        db_obj \u003d _get_rule(context, id)"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba3cc151_d5ee88b3","line":65,"in_reply_to":"ba3cc151_168c0f34","updated":"2015-07-01 06:57:16.000000000","message":"Agreed. I also don\u0027t like redundancy :)","commit_id":"d62ca6d3ad97acb85b7c7156101514a44343ea52"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"03f3b7b234a4b80ee3d2decdb456fe01eb3c09c1","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright 2015 RedHat, Inc."},{"line_number":2,"context_line":"# All Rights Reserved."},{"line_number":3,"context_line":"#"},{"line_number":4,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba3cc151_ed6e642e","line":1,"updated":"2015-07-01 08:14:20.000000000","message":"I don\u0027t mind having it mentioned here, but if it is, it should be \u0027Red Hat, Inc.\u0027, with a space char.","commit_id":"6368f40d5b44b786c65ae0e3d19c2566b169a25d"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"03f3b7b234a4b80ee3d2decdb456fe01eb3c09c1","unresolved":false,"context_lines":[{"line_number":46,"context_line":"        db_obj.delete()"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"@obj_base.VersionedObjectRegistry.register"},{"line_number":50,"context_line":"class Qos_Db_Mixin(obj_base.VersionedObject):"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"    @staticmethod"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba3cc151_4dd510b7","line":49,"updated":"2015-07-01 08:14:20.000000000","message":"No, we should not register the base class, instead all subclasses should do it on their own.","commit_id":"6368f40d5b44b786c65ae0e3d19c2566b169a25d"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"03f3b7b234a4b80ee3d2decdb456fe01eb3c09c1","unresolved":false,"context_lines":[{"line_number":47,"context_line":""},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"@obj_base.VersionedObjectRegistry.register"},{"line_number":50,"context_line":"class Qos_Db_Mixin(obj_base.VersionedObject):"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"    @staticmethod"},{"line_number":53,"context_line":"    def _from_db_object(context, obj, db_obj):"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba3cc151_8dcb181e","line":50,"updated":"2015-07-01 08:14:20.000000000","message":"It is not a part of db api, but a base for neutron versionedobjects. Let\u0027s move it under neutron/objects/ (neutron/objects/base.py?)\n\nAlso, let\u0027s name it e.g. NeutronVersionedObject.","commit_id":"6368f40d5b44b786c65ae0e3d19c2566b169a25d"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"03f3b7b234a4b80ee3d2decdb456fe01eb3c09c1","unresolved":false,"context_lines":[{"line_number":62,"context_line":"        db_obj \u003d create_object(self._context, db_model, fields)"},{"line_number":63,"context_line":"        self._from_db_object(self._context, self, db_obj)"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    def save(self, db_model):"},{"line_number":66,"context_line":"        updates \u003d self.obj_get_changes()"},{"line_number":67,"context_line":"        db_obj \u003d update_object(self._context, db_model,"},{"line_number":68,"context_line":"                               self.id, updates)"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba3cc151_6d649421","line":65,"updated":"2015-07-01 08:14:20.000000000","message":"subclass public interface (.save) should not require passing a model as an argument. Instead it should be a private method (_save?) that receives the argument. Alternatively, we could attach the model class as an attribute to NeutronVersionedObject, and then reuse it.","commit_id":"6368f40d5b44b786c65ae0e3d19c2566b169a25d"}],"neutron/objects/base.py":[{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"9e9db1bdf94fd9f8d2ffc6a897799c6b5168ac6c","unresolved":false,"context_lines":[{"line_number":24,"context_line":"    # should be overridden for all persistent objects"},{"line_number":25,"context_line":"    db_model \u003d None"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"    def from_db_object(self, *objs):"},{"line_number":28,"context_line":"        for field in self.fields:"},{"line_number":29,"context_line":"            for db_obj in objs:"},{"line_number":30,"context_line":"                if field in db_obj:"}],"source_content_type":"text/x-python","patch_set":6,"id":"ba3cc151_ea4ddb3e","line":27,"updated":"2015-07-01 12:56:04.000000000","message":"from_db_objects (your own comment)\nand use objs as a list so you could add more parameters later if needed.","commit_id":"870766b4ae039021ddd16240fd5dbb5ef907bc52"},{"author":{"_account_id":6951,"name":"Brandon Logan","email":"brandon.logan@rackspace.com","username":"brandon-logan"},"change_message_id":"eb0f52ed1ccd5c2d96780cc895a380e73b233158","unresolved":false,"context_lines":[{"line_number":18,"context_line":"from neutron.db import api as db_api"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"@six.add_metaclass(abc.ABCMeta)"},{"line_number":22,"context_line":"class NeutronObject(obj_base.VersionedObject):"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"    # should be overridden for all persistent objects"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba3cc151_0206bf1c","line":21,"updated":"2015-07-02 03:16:48.000000000","message":"is this necessary since this class isn\u0027t using any abstract methods/properties?","commit_id":"03074e7001944c05f8b20d626cccdbf536165894"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"74332f8165285292faeaa54bf9af28c756b6c821","unresolved":false,"context_lines":[{"line_number":18,"context_line":"from neutron.db import api as db_api"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"@six.add_metaclass(abc.ABCMeta)"},{"line_number":22,"context_line":"class NeutronObject(obj_base.VersionedObject):"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"    # should be overridden for all persistent objects"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba3cc151_de4aef25","line":21,"in_reply_to":"ba3cc151_0206bf1c","updated":"2015-07-02 07:23:26.000000000","message":"Well... it\u0027s not supposed to be instantiated, at least for now, while we assume objects are always db persisted.","commit_id":"03074e7001944c05f8b20d626cccdbf536165894"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"c70030c6afa33c340de211a86d76ab2060b6b336","unresolved":false,"context_lines":[{"line_number":31,"context_line":"                    setattr(self, field, db_obj[field])"},{"line_number":32,"context_line":"                break"},{"line_number":33,"context_line":"        self.obj_reset_changes()"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"    @classmethod"},{"line_number":36,"context_line":"    def get_by_id(cls, context, id):"},{"line_number":37,"context_line":"        db_obj \u003d db_api.get_object(context, cls.db_model, id)"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba3cc151_d237504b","line":34,"updated":"2015-07-01 21:29:21.000000000","message":"add get_all() for list operation","commit_id":"03074e7001944c05f8b20d626cccdbf536165894"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"74332f8165285292faeaa54bf9af28c756b6c821","unresolved":false,"context_lines":[{"line_number":31,"context_line":"                    setattr(self, field, db_obj[field])"},{"line_number":32,"context_line":"                break"},{"line_number":33,"context_line":"        self.obj_reset_changes()"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"    @classmethod"},{"line_number":36,"context_line":"    def get_by_id(cls, context, id):"},{"line_number":37,"context_line":"        db_obj \u003d db_api.get_object(context, cls.db_model, id)"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba3cc151_7e6ac382","line":34,"in_reply_to":"ba3cc151_586fd62a","updated":"2015-07-02 07:23:26.000000000","message":"Done","commit_id":"03074e7001944c05f8b20d626cccdbf536165894"},{"author":{"_account_id":12444,"name":"John Schwarz","email":"jschwarz@redhat.com","username":"jschwarz"},"change_message_id":"5e6932b62d76c8c8ca3f5e0eda3a4fd34f881514","unresolved":false,"context_lines":[{"line_number":31,"context_line":"                    setattr(self, field, db_obj[field])"},{"line_number":32,"context_line":"                break"},{"line_number":33,"context_line":"        self.obj_reset_changes()"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"    @classmethod"},{"line_number":36,"context_line":"    def get_by_id(cls, context, id):"},{"line_number":37,"context_line":"        db_obj \u003d db_api.get_object(context, cls.db_model, id)"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba3cc151_586fd62a","line":34,"in_reply_to":"ba3cc151_d237504b","updated":"2015-07-02 05:40:37.000000000","message":"@classmethod\n    def get_all_objects(cls, context):\n        db_objs \u003d db_api.get_objects(context, cls.db_model)\n        objs \u003d [cls(context, **db_obj) for db_obj in db_objs]\n        return objs","commit_id":"03074e7001944c05f8b20d626cccdbf536165894"},{"author":{"_account_id":12444,"name":"John Schwarz","email":"jschwarz@redhat.com","username":"jschwarz"},"change_message_id":"5e6932b62d76c8c8ca3f5e0eda3a4fd34f881514","unresolved":false,"context_lines":[{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    def create(self):"},{"line_number":41,"context_line":"        fields \u003d self.obj_get_changes()"},{"line_number":42,"context_line":"        db_obj \u003d db_api.create_object(self._context, self.db_model, fields)"},{"line_number":43,"context_line":"        self.from_db_object(db_obj)"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"    def update(self):"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba3cc151_d861a63a","line":42,"updated":"2015-07-02 05:40:37.000000000","message":"This function should return \u0027db_obj\u0027.","commit_id":"03074e7001944c05f8b20d626cccdbf536165894"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"74332f8165285292faeaa54bf9af28c756b6c821","unresolved":false,"context_lines":[{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    def create(self):"},{"line_number":41,"context_line":"        fields \u003d self.obj_get_changes()"},{"line_number":42,"context_line":"        db_obj \u003d db_api.create_object(self._context, self.db_model, fields)"},{"line_number":43,"context_line":"        self.from_db_object(db_obj)"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"    def update(self):"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba3cc151_5ebd7fb5","line":42,"in_reply_to":"ba3cc151_d861a63a","updated":"2015-07-02 07:23:26.000000000","message":"I\u0027ll make the objects dict compat for now.","commit_id":"03074e7001944c05f8b20d626cccdbf536165894"},{"author":{"_account_id":12444,"name":"John Schwarz","email":"jschwarz@redhat.com","username":"jschwarz"},"change_message_id":"5e6932b62d76c8c8ca3f5e0eda3a4fd34f881514","unresolved":false,"context_lines":[{"line_number":44,"context_line":""},{"line_number":45,"context_line":"    def update(self):"},{"line_number":46,"context_line":"        updates \u003d self.obj_get_changes()"},{"line_number":47,"context_line":"        db_obj \u003d db_api.update_object(self._context, self.db_model,"},{"line_number":48,"context_line":"                                      self.id, updates)"},{"line_number":49,"context_line":"        self.from_db_object(self, db_obj)"},{"line_number":50,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"ba3cc151_98579e59","line":47,"updated":"2015-07-02 05:40:37.000000000","message":"This function should return \u0027db_obj\u0027 as well.","commit_id":"03074e7001944c05f8b20d626cccdbf536165894"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"74332f8165285292faeaa54bf9af28c756b6c821","unresolved":false,"context_lines":[{"line_number":44,"context_line":""},{"line_number":45,"context_line":"    def update(self):"},{"line_number":46,"context_line":"        updates \u003d self.obj_get_changes()"},{"line_number":47,"context_line":"        db_obj \u003d db_api.update_object(self._context, self.db_model,"},{"line_number":48,"context_line":"                                      self.id, updates)"},{"line_number":49,"context_line":"        self.from_db_object(self, db_obj)"},{"line_number":50,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"ba3cc151_becccb6a","line":47,"in_reply_to":"ba3cc151_98579e59","updated":"2015-07-02 07:23:26.000000000","message":"ditto","commit_id":"03074e7001944c05f8b20d626cccdbf536165894"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"320ac87d4e06fe3704a70b39d882593f59af5eb1","unresolved":false,"context_lines":[{"line_number":20,"context_line":""},{"line_number":21,"context_line":"# TODO(QoS): revisit dict compatibility and how we can isolate dict behavior"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"@six.add_metaclass(abc.ABCMeta)"},{"line_number":25,"context_line":"class NeutronObject(obj_base.VersionedObject,"},{"line_number":26,"context_line":"                    obj_base.VersionedObjectDictCompat):"}],"source_content_type":"text/x-python","patch_set":9,"id":"ba3cc151_41a362b2","line":23,"updated":"2015-07-02 06:48:12.000000000","message":"I agree :)","commit_id":"e90b28662eb769e26f2f6c202a71910819c3ff41"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"3842109b8f861bae554a0c4285cd7369b80798bb","unresolved":false,"context_lines":[{"line_number":37,"context_line":"        self.obj_reset_changes()"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"    @classmethod"},{"line_number":40,"context_line":"    def get_by_id(cls, context, id):"},{"line_number":41,"context_line":"        db_obj \u003d db_api.get_object(context, cls.db_model, id)"},{"line_number":42,"context_line":"        return cls(context, **db_obj)"},{"line_number":43,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"ba3cc151_c7746269","line":40,"updated":"2015-07-02 08:04:06.000000000","message":"Nit: Can we use \u0027obj_id\u0027 or something instead of \u0027id\u0027?\n\u0027id\u0027 is a reserved word in Python and I would like to avoid using it for a new code. It is just an opinion.","commit_id":"e90b28662eb769e26f2f6c202a71910819c3ff41"}],"neutron/objects/qos/policy.py":[{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"91d3d8e82287865add71d54787feaf9fd954cfca","unresolved":false,"context_lines":[{"line_number":27,"context_line":"        \u0027description\u0027: obj_fields.StringField(),"},{"line_number":28,"context_line":"        \u0027shared\u0027: obj_fields.BooleanField()"},{"line_number":29,"context_line":"    }"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"    @staticmethod"},{"line_number":32,"context_line":"    def _from_db_object(context, obj, db_obj):"},{"line_number":33,"context_line":"        for field in obj.fields:"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba3cc151_1693af50","line":30,"updated":"2015-06-30 19:32:57.000000000","message":"Those methods are so similar in both policies and rules that we may want to move common stuff into a separate \u0027mixin\u0027 or smth.","commit_id":"d62ca6d3ad97acb85b7c7156101514a44343ea52"},{"author":{"_account_id":14605,"name":"vikram.choudhary","email":"vikschw@gmail.com","username":"vikram.choudhary"},"change_message_id":"cd03c8e841c13c25d7b87b8ea5f6cf734f611f35","unresolved":false,"context_lines":[{"line_number":27,"context_line":"        \u0027description\u0027: obj_fields.StringField(),"},{"line_number":28,"context_line":"        \u0027shared\u0027: obj_fields.BooleanField()"},{"line_number":29,"context_line":"    }"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"    @staticmethod"},{"line_number":32,"context_line":"    def _from_db_object(context, obj, db_obj):"},{"line_number":33,"context_line":"        for field in obj.fields:"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba3cc151_75bd3c67","line":30,"in_reply_to":"ba3cc151_1693af50","updated":"2015-07-01 06:57:16.000000000","message":"Will check on this.","commit_id":"d62ca6d3ad97acb85b7c7156101514a44343ea52"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"03f3b7b234a4b80ee3d2decdb456fe01eb3c09c1","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright 2015 RedHat, Inc."},{"line_number":2,"context_line":"# All Rights Reserved."},{"line_number":3,"context_line":"#"},{"line_number":4,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba3cc151_ed78a4c6","line":1,"updated":"2015-07-01 08:14:20.000000000","message":"ditto","commit_id":"6368f40d5b44b786c65ae0e3d19c2566b169a25d"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"44d403bea0e70790e7f24b3bcde31d3c4360d93b","unresolved":false,"context_lines":[{"line_number":30,"context_line":"        \u0027tenant_id\u0027: obj_fields.UUIDField(),"},{"line_number":31,"context_line":"        \u0027name\u0027: obj_fields.StringField(),"},{"line_number":32,"context_line":"        \u0027description\u0027: obj_fields.StringField(),"},{"line_number":33,"context_line":"        \u0027shared\u0027: obj_fields.BooleanField()"},{"line_number":34,"context_line":"    }"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba3cc151_f5059e79","line":33,"updated":"2015-07-01 22:10:32.000000000","message":"hmm, you\u0027re missing \u0027rules\u0027 :)\n\nrules\u0027: obj_fields.ListOfObjectsField(\u0027QoSRule\u0027)}\n\nI wonder how will it play with the subclasses, at worst we can add a method to QoSRule to return the right QoSRule sub-object.","commit_id":"03074e7001944c05f8b20d626cccdbf536165894"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"c6828eb82e8de257cacfd7be185d179d567c5dd0","unresolved":false,"context_lines":[{"line_number":30,"context_line":"        \u0027tenant_id\u0027: obj_fields.UUIDField(),"},{"line_number":31,"context_line":"        \u0027name\u0027: obj_fields.StringField(),"},{"line_number":32,"context_line":"        \u0027description\u0027: obj_fields.StringField(),"},{"line_number":33,"context_line":"        \u0027shared\u0027: obj_fields.BooleanField()"},{"line_number":34,"context_line":"    }"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba3cc151_2185fe05","line":33,"in_reply_to":"ba3cc151_269c3e0e","updated":"2015-07-02 06:49:09.000000000","message":"Ahh, very nice Dan, thanks for the feedback on this :)","commit_id":"03074e7001944c05f8b20d626cccdbf536165894"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"74332f8165285292faeaa54bf9af28c756b6c821","unresolved":false,"context_lines":[{"line_number":30,"context_line":"        \u0027tenant_id\u0027: obj_fields.UUIDField(),"},{"line_number":31,"context_line":"        \u0027name\u0027: obj_fields.StringField(),"},{"line_number":32,"context_line":"        \u0027description\u0027: obj_fields.StringField(),"},{"line_number":33,"context_line":"        \u0027shared\u0027: obj_fields.BooleanField()"},{"line_number":34,"context_line":"    }"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba3cc151_9ebf87a9","line":33,"in_reply_to":"ba3cc151_269c3e0e","updated":"2015-07-02 07:23:26.000000000","message":"Those fields may belong to later patches. I\u0027ll add TODO.","commit_id":"03074e7001944c05f8b20d626cccdbf536165894"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"2c6cba8a7f0d953ff6f8b08356936e88c7bbc525","unresolved":false,"context_lines":[{"line_number":30,"context_line":"        \u0027tenant_id\u0027: obj_fields.UUIDField(),"},{"line_number":31,"context_line":"        \u0027name\u0027: obj_fields.StringField(),"},{"line_number":32,"context_line":"        \u0027description\u0027: obj_fields.StringField(),"},{"line_number":33,"context_line":"        \u0027shared\u0027: obj_fields.BooleanField()"},{"line_number":34,"context_line":"    }"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba3cc151_269c3e0e","line":33,"in_reply_to":"ba3cc151_60bf8eaa","updated":"2015-07-01 23:23:29.000000000","message":"Subclasses are handled strictly by name at this point, not in the normal way you\u0027d think of an object model. There are plans afoot to address this:\n\nhttps://review.openstack.org/#/c/193204/\n\nYou might be able to pick that up in 0.5.1 (I think). If so, let us know how it goes :)","commit_id":"03074e7001944c05f8b20d626cccdbf536165894"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"0a8d1718aa72fdf887f1b3032217fbd299eec082","unresolved":false,"context_lines":[{"line_number":30,"context_line":"        \u0027tenant_id\u0027: obj_fields.UUIDField(),"},{"line_number":31,"context_line":"        \u0027name\u0027: obj_fields.StringField(),"},{"line_number":32,"context_line":"        \u0027description\u0027: obj_fields.StringField(),"},{"line_number":33,"context_line":"        \u0027shared\u0027: obj_fields.BooleanField()"},{"line_number":34,"context_line":"    }"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba3cc151_60bf8eaa","line":33,"in_reply_to":"ba3cc151_f5059e79","updated":"2015-07-01 22:19:45.000000000","message":"Hmm, may be we will need to provide a list for every rule type as we do in the API ? (and Irena was right in other comments over dicts being passed around for agents), \n\n\u0027bandwidth_limiting_rules\u0027 : obj_fields.ListOfObjectsField(\u0027QosBandwidthLimitRule\u0027)","commit_id":"03074e7001944c05f8b20d626cccdbf536165894"}],"neutron/objects/qos/rule.py":[{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"97434ad78016d8828f4b59a7ece1589a3b0bad94","unresolved":false,"context_lines":[{"line_number":21,"context_line":""},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"@obj_base.VersionedObjectRegistry.register"},{"line_number":24,"context_line":"class QosRule(obj_base.VersionedObject):"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"    fields \u003d {"},{"line_number":27,"context_line":"        \u0027type\u0027: obj_fields.StringField(),"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba3cc151_8a21e5b6","line":24,"updated":"2015-06-30 15:05:34.000000000","message":"We should not have a generic versioned object type. We should have a type per specific rule. That said, there is place for code reuse.","commit_id":"d62ca6d3ad97acb85b7c7156101514a44343ea52"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"c0fd814c7a49638efbf2c7fb604181eb2373bae8","unresolved":false,"context_lines":[{"line_number":21,"context_line":""},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"@obj_base.VersionedObjectRegistry.register"},{"line_number":24,"context_line":"class QosRule(obj_base.VersionedObject):"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"    fields \u003d {"},{"line_number":27,"context_line":"        \u0027type\u0027: obj_fields.StringField(),"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba3cc151_f6e96b1b","line":24,"in_reply_to":"ba3cc151_8a21e5b6","updated":"2015-06-30 19:28:14.000000000","message":"Correct I agree:\n\nThis is how table inheritance is handled in version objects I think:\n\nhttps://github.com/openstack/oslo.versionedobjects/blob/master/oslo_versionedobjects/tests/test_objects.py#L150\n\nhttps://github.com/openstack/oslo.versionedobjects/blob/master/oslo_versionedobjects/tests/test_objects.py#L837","commit_id":"d62ca6d3ad97acb85b7c7156101514a44343ea52"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"9e9db1bdf94fd9f8d2ffc6a897799c6b5168ac6c","unresolved":false,"context_lines":[{"line_number":72,"context_line":"            self._context, self.db_model, addn_fields)"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"        # merge two db objects into single neutron one"},{"line_number":75,"context_line":"        self.from_db_object(self._context, self, base_db_obj, addn_db_obj)"},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"    def update(self):"},{"line_number":78,"context_line":"        updated_db_objs \u003d []"}],"source_content_type":"text/x-python","patch_set":6,"id":"ba3cc151_8a8f6f29","line":75,"updated":"2015-07-01 12:56:04.000000000","message":"from_db_object(...., [base_db_obj, add_db_obj])\n\nI\u0027d make the list explicit so you\u0027d be able to add more parameters to from_db_object if needed in the future.","commit_id":"870766b4ae039021ddd16240fd5dbb5ef907bc52"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"8b223765134baa68b5e9735e49690e6cad8f1a57","unresolved":false,"context_lines":[{"line_number":48,"context_line":"            key: val for key, val in fields.items()"},{"line_number":49,"context_line":"            if func(key)"},{"line_number":50,"context_line":"        }"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"    def _get_changed_core_fields(self):"},{"line_number":53,"context_line":"        fields \u003d self.obj_get_changes()"},{"line_number":54,"context_line":"        return self._filter_fields(fields, self._is_core_field)"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba3cc151_b2fbac7a","line":51,"updated":"2015-07-01 21:28:53.000000000","message":"get_by_id should be custom for qos_rules too since we should merge data from different db objects into single versioned one.","commit_id":"03074e7001944c05f8b20d626cccdbf536165894"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"8b223765134baa68b5e9735e49690e6cad8f1a57","unresolved":false,"context_lines":[{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    def create(self):"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"        # create base qos_rule"},{"line_number":64,"context_line":"        core_fields \u003d self._get_changed_core_fields()"},{"line_number":65,"context_line":"        base_db_obj \u003d db_api.create_object("},{"line_number":66,"context_line":"            self._context, self.base_db_model, core_fields)"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba3cc151_32c23c35","line":63,"updated":"2015-07-01 21:28:53.000000000","message":"create and update of two objects is not in single transaction!","commit_id":"03074e7001944c05f8b20d626cccdbf536165894"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"74332f8165285292faeaa54bf9af28c756b6c821","unresolved":false,"context_lines":[{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    def create(self):"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"        # create base qos_rule"},{"line_number":64,"context_line":"        core_fields \u003d self._get_changed_core_fields()"},{"line_number":65,"context_line":"        base_db_obj \u003d db_api.create_object("},{"line_number":66,"context_line":"            self._context, self.base_db_model, core_fields)"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba3cc151_3e067b86","line":63,"in_reply_to":"ba3cc151_32c23c35","updated":"2015-07-02 07:23:26.000000000","message":"Done","commit_id":"03074e7001944c05f8b20d626cccdbf536165894"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"3842109b8f861bae554a0c4285cd7369b80798bb","unresolved":false,"context_lines":[{"line_number":98,"context_line":""},{"line_number":99,"context_line":"    # delete is the same, additional rule object cleanup is done thru cascading"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"@obj_base.VersionedObjectRegistry.register"},{"line_number":103,"context_line":"class QosBandwidthLimitRule(QosRule):"},{"line_number":104,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"ba3cc151_07424a68","line":101,"updated":"2015-07-02 08:04:06.000000000","message":"Question: How does \"VERSION\" evolve? When we update QoSRule base class, do we need to increment \"VERSION\" in all sub classes?\n\nIsn\u0027t it better to have VERSION here even though the default value is \"1.0\"? I think it is clearer for developers.","commit_id":"e90b28662eb769e26f2f6c202a71910819c3ff41"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"2e439550bdf2604ce55f8835aa64f8728169a094","unresolved":false,"context_lines":[{"line_number":98,"context_line":""},{"line_number":99,"context_line":"    # delete is the same, additional rule object cleanup is done thru cascading"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"@obj_base.VersionedObjectRegistry.register"},{"line_number":103,"context_line":"class QosBandwidthLimitRule(QosRule):"},{"line_number":104,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"ba3cc151_b2971a47","line":101,"in_reply_to":"ba3cc151_07424a68","updated":"2015-07-02 08:08:27.000000000","message":"We will think about versioning later.","commit_id":"e90b28662eb769e26f2f6c202a71910819c3ff41"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"e60bfd9aadae946053943df5c8e47e029293315c","unresolved":false,"context_lines":[{"line_number":98,"context_line":""},{"line_number":99,"context_line":"    # delete is the same, additional rule object cleanup is done thru cascading"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"@obj_base.VersionedObjectRegistry.register"},{"line_number":103,"context_line":"class QosBandwidthLimitRule(QosRule):"},{"line_number":104,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"ba3cc151_edf067ff","line":101,"in_reply_to":"ba3cc151_b2971a47","updated":"2015-07-02 08:23:55.000000000","message":"Yeah, we can start with VERSION \u003d \u00271.0\u0027 and make it explicit in a follow up. I agree.","commit_id":"e90b28662eb769e26f2f6c202a71910819c3ff41"}]}
