)]}'
{"cinder/context.py":[{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"1b9432fdb77471f035d1a8569ba62cd8316ebb97","unresolved":false,"context_lines":[{"line_number":108,"context_line":""},{"line_number":109,"context_line":"    def to_dict(self):"},{"line_number":110,"context_line":"        result \u003d super(RequestContext, self).to_dict()"},{"line_number":111,"context_line":"        result[\u0027user_id\u0027] \u003d self.user_id"},{"line_number":112,"context_line":"        result[\u0027project_id\u0027] \u003d self.project_id"},{"line_number":113,"context_line":"        result[\u0027project_name\u0027] \u003d self.project_name"},{"line_number":114,"context_line":"        result[\u0027domain\u0027] \u003d self.domain"}],"source_content_type":"text/x-python","patch_set":1,"id":"1af86dd1_fcff4932","line":111,"updated":"2015-06-12 18:14:55.000000000","message":"Why do this instead of using update?","commit_id":"0256d88719ece09f9c376d859ba57f7ff459b5e1"},{"author":{"_account_id":9107,"name":"Victor Stinner","email":"vstinner@redhat.com","username":"haypo"},"change_message_id":"aad8e39e4d686b286b1dcbc5d3496f9d63c954d6","unresolved":false,"context_lines":[{"line_number":108,"context_line":""},{"line_number":109,"context_line":"    def to_dict(self):"},{"line_number":110,"context_line":"        result \u003d super(RequestContext, self).to_dict()"},{"line_number":111,"context_line":"        result[\u0027user_id\u0027] \u003d self.user_id"},{"line_number":112,"context_line":"        result[\u0027project_id\u0027] \u003d self.project_id"},{"line_number":113,"context_line":"        result[\u0027project_name\u0027] \u003d self.project_name"},{"line_number":114,"context_line":"        result[\u0027domain\u0027] \u003d self.domain"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa32b979_ade2edd3","line":111,"in_reply_to":"1af86dd1_fcff4932","updated":"2015-06-15 08:42:13.000000000","message":"IMO it\u0027s more readable than a dictionary and more explicit. But I have no strong argument in favor of this syntax, I can use a dictionary if you prefer.","commit_id":"0256d88719ece09f9c376d859ba57f7ff459b5e1"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"487dc72087b20f4796e1e876118f419f0b97bf0b","unresolved":false,"context_lines":[{"line_number":108,"context_line":""},{"line_number":109,"context_line":"    def to_dict(self):"},{"line_number":110,"context_line":"        result \u003d super(RequestContext, self).to_dict()"},{"line_number":111,"context_line":"        result[\u0027user_id\u0027] \u003d self.user_id"},{"line_number":112,"context_line":"        result[\u0027project_id\u0027] \u003d self.project_id"},{"line_number":113,"context_line":"        result[\u0027project_name\u0027] \u003d self.project_name"},{"line_number":114,"context_line":"        result[\u0027domain\u0027] \u003d self.domain"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa32b979_b8630db1","line":111,"in_reply_to":"fa32b979_ade2edd3","updated":"2015-06-15 09:08:45.000000000","message":"I have no strong feelings either way, but I usually find it easier to read with the dictionary as it was.\n\nIt\u0027s fine as it is, and thank\u0027s for the reply.","commit_id":"0256d88719ece09f9c376d859ba57f7ff459b5e1"}],"cinder/volume/manager.py":[{"author":{"_account_id":7219,"name":"git-harry","email":"git-harry@live.co.uk","username":"git-harry"},"change_message_id":"f56939d2bf642b1536c01ccf57a6378f75fbd189","unresolved":false,"context_lines":[{"line_number":1205,"context_line":"        rpcapi \u003d volume_rpcapi.VolumeAPI()"},{"line_number":1206,"context_line":""},{"line_number":1207,"context_line":"        # Create new volume on remote host"},{"line_number":1208,"context_line":"        new_vol_values \u003d dict(volume)"},{"line_number":1209,"context_line":"        del new_vol_values[\u0027id\u0027]"},{"line_number":1210,"context_line":"        del new_vol_values[\u0027_name_id\u0027]"},{"line_number":1211,"context_line":"        # We don\u0027t copy volume_type because the db sets that according to"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa32b979_7f54a853","line":1208,"updated":"2015-06-13 10:01:14.000000000","message":"I think volume.copy() would be better here because it makes things clearer.","commit_id":"0256d88719ece09f9c376d859ba57f7ff459b5e1"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"487dc72087b20f4796e1e876118f419f0b97bf0b","unresolved":false,"context_lines":[{"line_number":1205,"context_line":"        rpcapi \u003d volume_rpcapi.VolumeAPI()"},{"line_number":1206,"context_line":""},{"line_number":1207,"context_line":"        # Create new volume on remote host"},{"line_number":1208,"context_line":"        new_vol_values \u003d dict(volume)"},{"line_number":1209,"context_line":"        del new_vol_values[\u0027id\u0027]"},{"line_number":1210,"context_line":"        del new_vol_values[\u0027_name_id\u0027]"},{"line_number":1211,"context_line":"        # We don\u0027t copy volume_type because the db sets that according to"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa32b979_b8bf8dcf","line":1208,"in_reply_to":"fa32b979_2da1fd94","updated":"2015-06-15 09:08:45.000000000","message":"No, volume.copy() would not work, since ModelBase is not a dictionary.\n\nAnd the reason why you can do a dict(volume) is because ModelBase is a subclass of six.Iterator: https://github.com/openstack/oslo.db/blob/master/oslo_db/sqlalchemy/models.py#L31","commit_id":"0256d88719ece09f9c376d859ba57f7ff459b5e1"},{"author":{"_account_id":9107,"name":"Victor Stinner","email":"vstinner@redhat.com","username":"haypo"},"change_message_id":"aad8e39e4d686b286b1dcbc5d3496f9d63c954d6","unresolved":false,"context_lines":[{"line_number":1205,"context_line":"        rpcapi \u003d volume_rpcapi.VolumeAPI()"},{"line_number":1206,"context_line":""},{"line_number":1207,"context_line":"        # Create new volume on remote host"},{"line_number":1208,"context_line":"        new_vol_values \u003d dict(volume)"},{"line_number":1209,"context_line":"        del new_vol_values[\u0027id\u0027]"},{"line_number":1210,"context_line":"        del new_vol_values[\u0027_name_id\u0027]"},{"line_number":1211,"context_line":"        # We don\u0027t copy volume_type because the db sets that according to"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa32b979_2da1fd94","line":1208,"in_reply_to":"fa32b979_7f54a853","updated":"2015-06-15 08:42:13.000000000","message":"volume comes from self.db.volume_get() or self.db.volume_update(), it\u0027s not a regular dictionary. I don\u0027t know if SQLAlchemy objects have a copy() object. An explicit conversion to a dictionary looks better to me.","commit_id":"0256d88719ece09f9c376d859ba57f7ff459b5e1"},{"author":{"_account_id":9107,"name":"Victor Stinner","email":"vstinner@redhat.com","username":"haypo"},"change_message_id":"ace7517af768892108f301a2b18401feb873e767","unresolved":false,"context_lines":[{"line_number":1205,"context_line":"        rpcapi \u003d volume_rpcapi.VolumeAPI()"},{"line_number":1206,"context_line":""},{"line_number":1207,"context_line":"        # Create new volume on remote host"},{"line_number":1208,"context_line":"        new_vol_values \u003d dict(volume)"},{"line_number":1209,"context_line":"        del new_vol_values[\u0027id\u0027]"},{"line_number":1210,"context_line":"        del new_vol_values[\u0027_name_id\u0027]"},{"line_number":1211,"context_line":"        # We don\u0027t copy volume_type because the db sets that according to"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa32b979_7849058b","line":1208,"in_reply_to":"fa32b979_b8bf8dcf","updated":"2015-06-15 09:22:26.000000000","message":"\u003e And the reason why you can do a dict(volume) is because ModelBase is a subclass of six.Iterator: https://github.com/openstack/oslo.db/blob/master/oslo_db/sqlalchemy/models.py#L31\n\ndict(obj) didn\u0027t work in oslo.db older than 1.10. I enhanced oslo.db to support writing directly dict(obj).\n\nSee also my other change: https://review.openstack.org/#/c/191064/","commit_id":"0256d88719ece09f9c376d859ba57f7ff459b5e1"}]}
