)]}'
{"nova/objects/instance.py":[{"author":{"_account_id":1030,"name":"Chris Behrens","email":"cbehrens@codestud.com","username":"cbehrens"},"change_message_id":"3b3849f3288c743686b6723bc549ffa55c2e2771","unresolved":false,"context_lines":[{"line_number":191,"context_line":"        if \u0027system_metadata\u0027 in expected_attrs:"},{"line_number":192,"context_line":"            columns_to_join.append(\u0027system_metadata\u0027)"},{"line_number":193,"context_line":"        if \u0027info_cache\u0027 in expected_attrs:"},{"line_number":194,"context_line":"            columns_to_join.append(\u0027info_cache\u0027)"},{"line_number":195,"context_line":""},{"line_number":196,"context_line":"        db_inst \u003d db.instance_get_by_uuid(context, uuid,"},{"line_number":197,"context_line":"                                          columns_to_join)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAPX%2F%2F9GM%3D","line":194,"updated":"2013-06-05 09:10:35.000000000","message":"Hm... this results in 2 options(joinedload(\u0027info_cache\u0027)) in _build_instance_get() in sqlalchemy/api.... since we always join it.","commit_id":"6c88ac0545942163a2bdb02f0b88fc25bba9ffcc"},{"author":{"_account_id":1030,"name":"Chris Behrens","email":"cbehrens@codestud.com","username":"cbehrens"},"change_message_id":"3b3849f3288c743686b6723bc549ffa55c2e2771","unresolved":false,"context_lines":[{"line_number":249,"context_line":"        elif attrname \u003d\u003d \u0027metadata\u0027:"},{"line_number":250,"context_line":"            extra.append(\u0027metadata\u0027)"},{"line_number":251,"context_line":"        elif attrname \u003d\u003d \u0027info_cache\u0027:"},{"line_number":252,"context_line":"            extra.append(\u0027info_cache\u0027)"},{"line_number":253,"context_line":""},{"line_number":254,"context_line":"        if not extra:"},{"line_number":255,"context_line":"            raise Exception(\u0027Cannot load \"%s\" from instance\u0027 % attrname)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAPX%2F%2F9GA%3D","line":252,"updated":"2013-06-05 09:10:35.000000000","message":"Goes along with above comment.. it\u0027s really always going to be there... right now.","commit_id":"6c88ac0545942163a2bdb02f0b88fc25bba9ffcc"},{"author":{"_account_id":1030,"name":"Chris Behrens","email":"cbehrens@codestud.com","username":"cbehrens"},"change_message_id":"4ef9b6c68181586624e616f8426b6fe56035ca09","unresolved":false,"context_lines":[{"line_number":220,"context_line":"        changes \u003d self.obj_what_changed()"},{"line_number":221,"context_line":"        for field in changes:"},{"line_number":222,"context_line":"            if isinstance(self[field], base.NovaObject):"},{"line_number":223,"context_line":"                self[field].save(context)"},{"line_number":224,"context_line":"            else:"},{"line_number":225,"context_line":"                updates[field] \u003d self[field]"},{"line_number":226,"context_line":"        if expected_task_state is not None:"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAPX%2F%2F6JI%3D","line":223,"updated":"2013-06-06 08:41:35.000000000","message":"Hm.  Imagine this:\ninstance \u003d Instance.get_by_uuid()\ninstance.info_cache.network_info \u003d something\ninstance.save()\n\nIn this case, \u0027info_cache\u0027 will not be in \u0027what_changed\u0027... so it won\u0027t get saved.\n\nAdditionally, if \u0027info_cache\u0027 itself happen to be set on the instance so that it is in what_changed()...  \u0027info_cache\u0027 ends up being passed into db.instance_update() and it appears it is not set up to handle it.  But you\u0027d only really set instance.info_cache when creating a fresh Instance w/ an empty InfoCache... hehe.\n\nI wonder if you should just handle info_cache explicitly in here for now.  Ie, always call info_cache.save() if the attr is set.  And make sure it\u0027s not in \u0027updates\u0027.","commit_id":"a732451aad9e142c92b6ac6ed0618085c72f857f"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"4add944f713c666a922f6781a44c1734e6f3ea2c","unresolved":false,"context_lines":[{"line_number":220,"context_line":"        changes \u003d self.obj_what_changed()"},{"line_number":221,"context_line":"        for field in changes:"},{"line_number":222,"context_line":"            if isinstance(self[field], base.NovaObject):"},{"line_number":223,"context_line":"                self[field].save(context)"},{"line_number":224,"context_line":"            else:"},{"line_number":225,"context_line":"                updates[field] \u003d self[field]"},{"line_number":226,"context_line":"        if expected_task_state is not None:"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAPX%2F%2F5pU%3D","line":223,"in_reply_to":"AAAAPX%2F%2F6JI%3D","updated":"2013-06-06 13:32:21.000000000","message":"It won\u0027t get passed to instance update right now, because this if clause keeps it out of updates.\n\nHowever, yeah, always calling save on it probably makes sense.","commit_id":"a732451aad9e142c92b6ac6ed0618085c72f857f"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"52ba9cc564cc08a5a65698158ec1705ceaa7b011","unresolved":false,"context_lines":[{"line_number":183,"context_line":"        if db_inst[\u0027info_cache\u0027]:"},{"line_number":184,"context_line":"            instance[\u0027info_cache\u0027] \u003d instance_info_cache.InstanceInfoCache()"},{"line_number":185,"context_line":"            instance_info_cache.InstanceInfoCache._from_db_object("},{"line_number":186,"context_line":"                instance[\u0027info_cache\u0027], db_inst[\u0027info_cache\u0027])"},{"line_number":187,"context_line":""},{"line_number":188,"context_line":"        instance.obj_reset_changes()"},{"line_number":189,"context_line":"        return instance"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAPX%2F%2FsCI%3D","line":186,"updated":"2013-06-12 19:32:52.000000000","message":"This is just a nitpick:  Because python doesn\u0027t really provide a way to indicate that an argument may be modified I prefer to see an explicit return over pass-by-reference style modifications.  But it\u0027s opinion and doesn\u0027t affect the validity of what this is doing.","commit_id":"e95807e8cda4463d7c9a2aab918bd2bda3d3cf9e"},{"author":{"_account_id":1030,"name":"Chris Behrens","email":"cbehrens@codestud.com","username":"cbehrens"},"change_message_id":"644adf4686df3cc9dd5611caa618213000a3c5b3","unresolved":false,"context_lines":[{"line_number":183,"context_line":"        if db_inst[\u0027info_cache\u0027]:"},{"line_number":184,"context_line":"            instance[\u0027info_cache\u0027] \u003d instance_info_cache.InstanceInfoCache()"},{"line_number":185,"context_line":"            instance_info_cache.InstanceInfoCache._from_db_object("},{"line_number":186,"context_line":"                instance[\u0027info_cache\u0027], db_inst[\u0027info_cache\u0027])"},{"line_number":187,"context_line":""},{"line_number":188,"context_line":"        instance.obj_reset_changes()"},{"line_number":189,"context_line":"        return instance"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAPX%2F%2Fr3o%3D","line":186,"in_reply_to":"AAAAPX%2F%2Fr4I%3D","updated":"2013-06-12 20:02:45.000000000","message":"Gotcha.  Yeah.  The first arg in your example would need to be InstanceInfoCache().  But yeah, I guess I\u0027d prefer what you\u0027re saying, also :)","commit_id":"e95807e8cda4463d7c9a2aab918bd2bda3d3cf9e"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"43289a9fdecc9af5c1d42fc858b032a9bd57fcf9","unresolved":false,"context_lines":[{"line_number":183,"context_line":"        if db_inst[\u0027info_cache\u0027]:"},{"line_number":184,"context_line":"            instance[\u0027info_cache\u0027] \u003d instance_info_cache.InstanceInfoCache()"},{"line_number":185,"context_line":"            instance_info_cache.InstanceInfoCache._from_db_object("},{"line_number":186,"context_line":"                instance[\u0027info_cache\u0027], db_inst[\u0027info_cache\u0027])"},{"line_number":187,"context_line":""},{"line_number":188,"context_line":"        instance.obj_reset_changes()"},{"line_number":189,"context_line":"        return instance"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAPX%2F%2Fr4I%3D","line":186,"in_reply_to":"AAAAPX%2F%2Fr7I%3D","updated":"2013-06-12 20:01:06.000000000","message":"Right, but it returns that object as well.  That\u0027s all I meant:\n\n    instance[\u0027info_cache\u0027] \u003d instance_info_cache.InstanceInfoCache._from_db_object(instance[\u0027info_cache\u0027], db_inst[\u0027info_cache\u0027])","commit_id":"e95807e8cda4463d7c9a2aab918bd2bda3d3cf9e"},{"author":{"_account_id":1030,"name":"Chris Behrens","email":"cbehrens@codestud.com","username":"cbehrens"},"change_message_id":"8a9f8fb95018b004b998fb4ba9661e67ff099d37","unresolved":false,"context_lines":[{"line_number":183,"context_line":"        if db_inst[\u0027info_cache\u0027]:"},{"line_number":184,"context_line":"            instance[\u0027info_cache\u0027] \u003d instance_info_cache.InstanceInfoCache()"},{"line_number":185,"context_line":"            instance_info_cache.InstanceInfoCache._from_db_object("},{"line_number":186,"context_line":"                instance[\u0027info_cache\u0027], db_inst[\u0027info_cache\u0027])"},{"line_number":187,"context_line":""},{"line_number":188,"context_line":"        instance.obj_reset_changes()"},{"line_number":189,"context_line":"        return instance"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAPX%2F%2Fr7I%3D","line":186,"in_reply_to":"AAAAPX%2F%2FsCI%3D","updated":"2013-06-12 19:48:01.000000000","message":"Yeah, not really a way to avoid that here.  _from_db_object() can update a fresh object or an object that was instantiated some time in the past... so it needs the object to update as an argument.","commit_id":"e95807e8cda4463d7c9a2aab918bd2bda3d3cf9e"},{"author":{"_account_id":5652,"name":"David Ripton","email":"dripton@redhat.com","username":"dripton"},"change_message_id":"7a9bb1bc03511ec2e104d5bde1a391fa14ddd5e0","unresolved":false,"context_lines":[{"line_number":224,"context_line":"        for field in self.fields:"},{"line_number":225,"context_line":"            if (hasattr(self, base.get_attrname(field)) and"},{"line_number":226,"context_line":"                isinstance(self[field], base.NovaObject)):"},{"line_number":227,"context_line":"                self[field].save(context)"},{"line_number":228,"context_line":"            elif field in changes:"},{"line_number":229,"context_line":"                updates[field] \u003d self[field]"},{"line_number":230,"context_line":"        if expected_task_state is not None:"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAPX%2F%2Fvs0%3D","line":227,"updated":"2013-06-11 14:46:40.000000000","message":"indentation is kind of unfortunate here","commit_id":"e95807e8cda4463d7c9a2aab918bd2bda3d3cf9e"},{"author":{"_account_id":7369,"name":"Sergey Skripnick","email":"sskripnick@mirantis.com","username":"redixin"},"change_message_id":"f29d6d503dd48c045804f2ce31247dc3c04d0320","unresolved":false,"context_lines":[{"line_number":257,"context_line":"                self[field] !\u003d current[field]):"},{"line_number":258,"context_line":"                self[field] \u003d current[field]"},{"line_number":259,"context_line":""},{"line_number":260,"context_line":"    def obj_load(self, attrname):"},{"line_number":261,"context_line":"        extra \u003d []"},{"line_number":262,"context_line":"        if attrname \u003d\u003d \u0027system_metadata\u0027:"},{"line_number":263,"context_line":"            extra.append(\u0027system_metadata\u0027)"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAPX%2F%2FzGk%3D","line":260,"updated":"2013-06-10 13:45:18.000000000","message":"instead of creating bunch of if\u0027s, and appending to empty list, you can do something like:\n\nif attrname not in allowed_attrnames:\n raise NovaException(\"...\")\nextra \u003d [attrname]","commit_id":"e95807e8cda4463d7c9a2aab918bd2bda3d3cf9e"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"2d28c461ca648b573f4e79fa4d0da6a33448f15c","unresolved":false,"context_lines":[{"line_number":257,"context_line":"                self[field] !\u003d current[field]):"},{"line_number":258,"context_line":"                self[field] \u003d current[field]"},{"line_number":259,"context_line":""},{"line_number":260,"context_line":"    def obj_load(self, attrname):"},{"line_number":261,"context_line":"        extra \u003d []"},{"line_number":262,"context_line":"        if attrname \u003d\u003d \u0027system_metadata\u0027:"},{"line_number":263,"context_line":"            extra.append(\u0027system_metadata\u0027)"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAPX%2F%2FzCU%3D","line":260,"in_reply_to":"AAAAPX%2F%2FzGk%3D","updated":"2013-06-10 13:54:30.000000000","message":"We\u0027re calling these out specifically for a reason. Right now, the column names in the database and the attribute names on the object happen to match. That\u0027s not necessarily going to be the case in the future (in fact, it will change before havana when I fix system_metadata to be a json blob). I\u0027d prefer to leave this as-is for now.\n\nAlso, I\u0027ll be following up later to convert all of these to be dispatched helper functions like the serialization code, which will eliminate the if then else block. That will happen before this grows any further.","commit_id":"e95807e8cda4463d7c9a2aab918bd2bda3d3cf9e"}],"nova/objects/instance_info_cache.py":[{"author":{"_account_id":1030,"name":"Chris Behrens","email":"cbehrens@codestud.com","username":"cbehrens"},"change_message_id":"3b3849f3288c743686b6723bc549ffa55c2e2771","unresolved":false,"context_lines":[{"line_number":16,"context_line":"from nova.objects import base"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"class InstanceInfoCache(base.NovaObject):"},{"line_number":20,"context_line":"    fields \u003d {"},{"line_number":21,"context_line":"        \u0027instance_uuid\u0027: str,"},{"line_number":22,"context_line":"        \u0027network_info\u0027: str,"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAPX%2F%2F9F0%3D","line":19,"updated":"2013-06-05 09:10:35.000000000","message":"I might have just thrown this into instance.py.  You had to import it from there anyway...","commit_id":"6c88ac0545942163a2bdb02f0b88fc25bba9ffcc"}],"nova/objects/utils.py":[{"author":{"_account_id":1030,"name":"Chris Behrens","email":"cbehrens@codestud.com","username":"cbehrens"},"change_message_id":"3b3849f3288c743686b6723bc549ffa55c2e2771","unresolved":false,"context_lines":[{"line_number":71,"context_line":"    def validator(val, objclass\u003dobjclass):"},{"line_number":72,"context_line":"        if val is None or isinstance(val, objclass):"},{"line_number":73,"context_line":"            return val"},{"line_number":74,"context_line":"        print val"},{"line_number":75,"context_line":"        raise ValueError(\u0027An object of class %s is required here\u0027 % objclass)"},{"line_number":76,"context_line":"    return validator"},{"line_number":77,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAPX%2F%2F9Fw%3D","line":74,"updated":"2013-06-05 09:10:35.000000000","message":"debug","commit_id":"6c88ac0545942163a2bdb02f0b88fc25bba9ffcc"}],"nova/tests/objects/test_instance_info_cache.py":[{"author":{"_account_id":5652,"name":"David Ripton","email":"dripton@redhat.com","username":"dripton"},"change_message_id":"7a9bb1bc03511ec2e104d5bde1a391fa14ddd5e0","unresolved":false,"context_lines":[{"line_number":41,"context_line":"        obj._context \u003d ctxt"},{"line_number":42,"context_line":"        obj.instance_uuid \u003d \u0027fake-uuid\u0027"},{"line_number":43,"context_line":"        obj.network_info \u003d \u0027foo\u0027"},{"line_number":44,"context_line":"        obj.save()"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"class TestInstanceInfoCacheObject(test_objects._LocalTest,"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAPX%2F%2FvtE%3D","line":44,"updated":"2013-06-11 14:46:40.000000000","message":"There are no asserts in this test.  Are you just looking for lack of exceptions?","commit_id":"e95807e8cda4463d7c9a2aab918bd2bda3d3cf9e"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"206fb0283171b5029df85dc372fdb60c42a2d504","unresolved":false,"context_lines":[{"line_number":41,"context_line":"        obj._context \u003d ctxt"},{"line_number":42,"context_line":"        obj.instance_uuid \u003d \u0027fake-uuid\u0027"},{"line_number":43,"context_line":"        obj.network_info \u003d \u0027foo\u0027"},{"line_number":44,"context_line":"        obj.save()"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"class TestInstanceInfoCacheObject(test_objects._LocalTest,"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAPX%2F%2FupE%3D","line":44,"in_reply_to":"AAAAPX%2F%2FvtE%3D","updated":"2013-06-11 19:50:02.000000000","message":"No. Mox will verify that db.instance_info_cache_update() was called with the expected arguments and raise an error after the test is done if it was not called.","commit_id":"e95807e8cda4463d7c9a2aab918bd2bda3d3cf9e"}]}
