)]}'
{"nova/compute/manager.py":[{"author":{"_account_id":1882,"name":"dave-mcnally","email":"dave.mcnally@hpe.com","username":"dave-mcnally"},"change_message_id":"60d302478b1f025943eceb586caab13539b2e2a9","unresolved":false,"context_lines":[{"line_number":3570,"context_line":""},{"line_number":3571,"context_line":"    def _update_volume_usage_cache(self, context, vol_usages, refreshed):"},{"line_number":3572,"context_line":"        \"\"\"Updates the volume usage cache table with a list of stats.\"\"\""},{"line_number":3573,"context_line":"        vol_info \u003d {}"},{"line_number":3574,"context_line":"        for usage in vol_usages:"},{"line_number":3575,"context_line":"            # Allow switching of greenthreads between queries."},{"line_number":3576,"context_line":"            greenthread.sleep(0)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAOH%2F%2F5tE%3D","line":3573,"updated":"2013-03-21 16:56:44.000000000","message":"Feels a bit like you\u0027re hijacking this method to do something it\u0027s not intended for. I\u0027d prefer to see the new functionality separated out into its own function and leave the update method just concerned with updating vol_usage and not also have it returning the unrelated vol_info.","commit_id":"f4f0cfcc778ef9bc02717c2a1d6beb5b7726f4ce"},{"author":{"_account_id":5638,"name":"Davanum Srinivas","email":"davanum@gmail.com","username":"dims-v"},"change_message_id":"6fe5a4f2280a9aa12090e98e9074a1376409cb2c","unresolved":false,"context_lines":[{"line_number":3636,"context_line":"                    refreshed \u003d timeutils.utcnow()"},{"line_number":3637,"context_line":"                    self._update_volume_usage_cache(context, vol_usages,"},{"line_number":3638,"context_line":"                                                    refreshed)"},{"line_number":3639,"context_line":"                    vol_info \u003d self._get_project_and_user_id(context,"},{"line_number":3640,"context_line":"                                                             vol_usages)"},{"line_number":3641,"context_line":""},{"line_number":3642,"context_line":"                self._send_volume_usage_notifications(context, vol_info,"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAOH%2F%2F23w%3D","line":3639,"updated":"2013-03-24 01:39:40.000000000","message":"why are we generating vol_info if start_time is not none?","commit_id":"d45036588751392df127c733db045f3dc61b885e"},{"author":{"_account_id":5638,"name":"Davanum Srinivas","email":"davanum@gmail.com","username":"dims-v"},"change_message_id":"6fe5a4f2280a9aa12090e98e9074a1376409cb2c","unresolved":false,"context_lines":[{"line_number":3639,"context_line":"                    vol_info \u003d self._get_project_and_user_id(context,"},{"line_number":3640,"context_line":"                                                             vol_usages)"},{"line_number":3641,"context_line":""},{"line_number":3642,"context_line":"                self._send_volume_usage_notifications(context, vol_info,"},{"line_number":3643,"context_line":"                                                      start_time)"},{"line_number":3644,"context_line":""},{"line_number":3645,"context_line":"    @manager.periodic_task"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAOH%2F%2F23s%3D","line":3642,"updated":"2013-03-24 01:39:40.000000000","message":"do we set initialize vol_info somewhere? since the code above generates vol_info under some conditions?","commit_id":"d45036588751392df127c733db045f3dc61b885e"},{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"263e7708d828cb22428549840ad5265941db963f","unresolved":false,"context_lines":[{"line_number":3591,"context_line":"                                                              start_time)"},{"line_number":3592,"context_line":"        for vol_usage in vol_usages:"},{"line_number":3593,"context_line":"            # Read the project and user id from the instances table."},{"line_number":3594,"context_line":"            filters \u003d {\u0027id\u0027: vol_usage[\u0027id\u0027]}"},{"line_number":3595,"context_line":"            instance \u003d self.conductor_api.instance_get_all_by_filters(context,"},{"line_number":3596,"context_line":"                                                                      filters)"},{"line_number":3597,"context_line":"            vol_usage[\u0027tenant_id\u0027] \u003d instance[0][\u0027project_id\u0027]"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAOH%2F%2F1ro%3D","line":3594,"updated":"2013-03-25 16:01:06.000000000","message":"Should that say vol_usage[\u0027instance_id\u0027]?","commit_id":"23e1d25c85f0276ca469e4d5b1b945d198c2248e"}],"nova/db/sqlalchemy/api.py":[{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"0e5d45e65138e3b4c5cdf6e3109c614b23d246d4","unresolved":false,"context_lines":[{"line_number":4053,"context_line":""},{"line_number":4054,"context_line":"@require_context"},{"line_number":4055,"context_line":"def vol_usage_update(context, id, rd_req, rd_bytes, wr_req, wr_bytes,"},{"line_number":4056,"context_line":"                     instance_id, project_id, user_id, last_refreshed\u003dNone,"},{"line_number":4057,"context_line":"                     update_totals\u003dFalse, session\u003dNone):"},{"line_number":4058,"context_line":"    if not session:"},{"line_number":4059,"context_line":"        session \u003d get_session()"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAOH%2F%2Fw4M%3D","line":4056,"updated":"2013-03-28 14:39:29.000000000","message":"Nit picking, but do you want to rename instance_id to instance_uuid to be consistent throughout?","commit_id":"68c5f1764b3b31b3726d01eb69d083ed18c96924"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"b792b6d9ac40a8b227570281ad486f1e35db7445","unresolved":false,"context_lines":[{"line_number":4053,"context_line":""},{"line_number":4054,"context_line":"@require_context"},{"line_number":4055,"context_line":"def vol_usage_update(context, id, rd_req, rd_bytes, wr_req, wr_bytes,"},{"line_number":4056,"context_line":"                     instance_id, project_id, user_id, last_refreshed\u003dNone,"},{"line_number":4057,"context_line":"                     update_totals\u003dFalse, session\u003dNone):"},{"line_number":4058,"context_line":"    if not session:"},{"line_number":4059,"context_line":"        session \u003d get_session()"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAOH%2F%2FwyQ%3D","line":4056,"in_reply_to":"AAAAOH%2F%2Fw10%3D","updated":"2013-03-28 15:42:49.000000000","message":"Some of that is due to the phased approach we took to switching from an integer ID to a UUID in the code, actually.","commit_id":"68c5f1764b3b31b3726d01eb69d083ed18c96924"},{"author":{"_account_id":1773,"name":"oliver-leahy-l","email":"oliver.leahy@hpe.com","username":"oliver-leahy-l"},"change_message_id":"d4c7c44425ad0cacf15d2bcbe1a5636fba0da27c","unresolved":false,"context_lines":[{"line_number":4053,"context_line":""},{"line_number":4054,"context_line":"@require_context"},{"line_number":4055,"context_line":"def vol_usage_update(context, id, rd_req, rd_bytes, wr_req, wr_bytes,"},{"line_number":4056,"context_line":"                     instance_id, project_id, user_id, last_refreshed\u003dNone,"},{"line_number":4057,"context_line":"                     update_totals\u003dFalse, session\u003dNone):"},{"line_number":4058,"context_line":"    if not session:"},{"line_number":4059,"context_line":"        session \u003d get_session()"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAOH%2F%2Fw10%3D","line":4056,"in_reply_to":"AAAAOH%2F%2Fw4M%3D","updated":"2013-03-28 14:59:41.000000000","message":"I changed the name of the column \u0027instance_id\u0027 in the table \u0027volume_usage_cache\u0027 to unstance_uuid, to match more closely with the name of the column \u0027uuid\u0027 in the table \u0027instances\u0027. That means that the model VolumeUsage now has a field called instance_uuid, instead of instance_id. Which is what was missed here.\n\nHowever, most variables, as far as I can see, keep the convention xxx_id, even though the id is a uuid, not an integer. I see examples of project_id and volume_id in this file. So I didn\u0027t change the name of the variable instance_id.","commit_id":"68c5f1764b3b31b3726d01eb69d083ed18c96924"}],"nova/db/sqlalchemy/migrate_repo/versions/172_add_project_user_id_to_volume_usage_cache.py":[{"author":{"_account_id":1030,"name":"Chris Behrens","email":"cbehrens@codestud.com","username":"cbehrens"},"change_message_id":"8fcf0e83b2970500690a5e683f5fa921f6c4645c","unresolved":false,"context_lines":[{"line_number":36,"context_line":""},{"line_number":37,"context_line":"    volume_usage_cache.create_column(instance_id)"},{"line_number":38,"context_line":"    volume_usage_cache.create_column(project_id)"},{"line_number":39,"context_line":"    volume_usage_cache.create_column(user_id)"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"def downgrade(migrate_engine):"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAOH%2F%2Ft38%3D","line":39,"updated":"2013-04-01 20:47:56.000000000","message":"Aren\u0027t you going to lose the instance_uuid for entries that aren\u0027t deleted yet?","commit_id":"68c5f1764b3b31b3726d01eb69d083ed18c96924"},{"author":{"_account_id":1773,"name":"oliver-leahy-l","email":"oliver.leahy@hpe.com","username":"oliver-leahy-l"},"change_message_id":"c8f60d61c537be1fdec77212f33a91bb5f248d14","unresolved":false,"context_lines":[{"line_number":36,"context_line":""},{"line_number":37,"context_line":"    volume_usage_cache.create_column(instance_id)"},{"line_number":38,"context_line":"    volume_usage_cache.create_column(project_id)"},{"line_number":39,"context_line":"    volume_usage_cache.create_column(user_id)"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"def downgrade(migrate_engine):"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAOH%2F%2FtB8%3D","line":39,"in_reply_to":"AAAAOH%2F%2Ft38%3D","updated":"2013-04-02 12:20:11.000000000","message":"I don\u0027t think we will lose any useful data. Before the migration the contents of the column \u0027instance_id\u0027 will contain a fairly random integer, based on the value of the instance uuid, basically the result of formatting the uuid as an integer. Since these integers are not useful, I think the best thing we can do is to drop the column and discard the data.\n\nFor volumes that are attached during the migration then the next time usage data is cached by nova.db.sqlalchemy.api.vol_usage_update() the correct value of the instance uuid will be written to the record for each attached volume.\n\nLet me know if I\u0027ve misunderstood your concern.","commit_id":"68c5f1764b3b31b3726d01eb69d083ed18c96924"}],"nova/db/sqlalchemy/models.py":[{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"0a7caf705574cb9cdcacb877947c2176d90a75fe","unresolved":false,"context_lines":[{"line_number":888,"context_line":"    __tablename__ \u003d \u0027volume_usage_cache\u0027"},{"line_number":889,"context_line":"    id \u003d Column(Integer, primary_key\u003dTrue, nullable\u003dFalse)"},{"line_number":890,"context_line":"    volume_id \u003d Column(String(36), nullable\u003dFalse)"},{"line_number":891,"context_line":"    instance_id \u003d Column(String(36))"},{"line_number":892,"context_line":"    project_id \u003d Column(String(36))"},{"line_number":893,"context_line":"    user_id \u003d Column(String(36))"},{"line_number":894,"context_line":"    tot_last_refreshed \u003d Column(DateTime)"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAAOH%2F%2Fx%2Fw%3D","line":891,"updated":"2013-03-27 18:17:12.000000000","message":"Let\u0027s change this to \"instance_uuid\" now, for consistency with the other models…","commit_id":"e3025b2ddacba874e291a66000c398feb191ad45"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"150773181cf70a4cd23aa084b7523352d4765a50","unresolved":false,"context_lines":[{"line_number":888,"context_line":"    __tablename__ \u003d \u0027volume_usage_cache\u0027"},{"line_number":889,"context_line":"    id \u003d Column(Integer, primary_key\u003dTrue, nullable\u003dFalse)"},{"line_number":890,"context_line":"    volume_id \u003d Column(String(36), nullable\u003dFalse)"},{"line_number":891,"context_line":"    instance_id \u003d Column(String(36))"},{"line_number":892,"context_line":"    project_id \u003d Column(String(36))"},{"line_number":893,"context_line":"    user_id \u003d Column(String(36))"},{"line_number":894,"context_line":"    tot_last_refreshed \u003d Column(DateTime)"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAAOH%2F%2Fx4s%3D","line":891,"in_reply_to":"AAAAOH%2F%2Fx%2Bc%3D","updated":"2013-03-27 19:52:45.000000000","message":"On the variable front, project_uuid would be a little clearer, but it\u0027s not a big deal IMO.  And the convention for project IDs and user IDs is, as you indicate, project_id and user_id, so no issue there.","commit_id":"e3025b2ddacba874e291a66000c398feb191ad45"},{"author":{"_account_id":1773,"name":"oliver-leahy-l","email":"oliver.leahy@hpe.com","username":"oliver-leahy-l"},"change_message_id":"331cf5466a113ffd0dffa7ef7a70502f90105245","unresolved":false,"context_lines":[{"line_number":888,"context_line":"    __tablename__ \u003d \u0027volume_usage_cache\u0027"},{"line_number":889,"context_line":"    id \u003d Column(Integer, primary_key\u003dTrue, nullable\u003dFalse)"},{"line_number":890,"context_line":"    volume_id \u003d Column(String(36), nullable\u003dFalse)"},{"line_number":891,"context_line":"    instance_id \u003d Column(String(36))"},{"line_number":892,"context_line":"    project_id \u003d Column(String(36))"},{"line_number":893,"context_line":"    user_id \u003d Column(String(36))"},{"line_number":894,"context_line":"    tot_last_refreshed \u003d Column(DateTime)"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAAOH%2F%2Fx%2Bc%3D","line":891,"in_reply_to":"AAAAOH%2F%2Fx%2Fw%3D","updated":"2013-03-27 18:36:50.000000000","message":"Done,  I\u0027ve left the variables as instance_id, to follow the convention of project_id and  user_id. And I\u0027ve left the project_id/user_id database field names as they were to follow the convention I see in the table instances for project and user ids.","commit_id":"e3025b2ddacba874e291a66000c398feb191ad45"}]}
