)]}'
{"trove/db/sqlalchemy/migrate_repo/versions/026_add_guest_agent_version.py":[{"author":{"_account_id":6156,"name":"Justin Hopper","email":"justin.hopper@hp.com","username":"justin-hopper"},"change_message_id":"8c26ca8f661c40cc4d2c0cd0176ed3ffd17b658a","unresolved":false,"context_lines":[{"line_number":34,"context_line":"                                agent_heartbeats.c.instance_id)"},{"line_number":35,"context_line":"        instance_id_idx.create()"},{"line_number":36,"context_line":"    except OperationalError as e:"},{"line_number":37,"context_line":"        logger.error(e)"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"    try:"},{"line_number":40,"context_line":"        guest_agent_version \u003d Column(\u0027guest_agent_version\u0027, String(255))"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAWH%2F%2FCYk%3D","line":37,"updated":"2014-03-20 18:38:31.000000000","message":"is it assumed that an error will be spotted and this error only occurs when the index already exists?  if not, then should we even catch the exception here?","commit_id":"0a5f8c71bb0b8742471493fc6f27f3e52ebd6da5"},{"author":{"_account_id":6162,"name":"Dan Nguyen","email":"dan.nguyens.mail@gmail.com","username":"daniel-a-nguyen"},"change_message_id":"83b2680c95e89205719b6ca0d5c75134f381264d","unresolved":false,"context_lines":[{"line_number":34,"context_line":"                                agent_heartbeats.c.instance_id)"},{"line_number":35,"context_line":"        instance_id_idx.create()"},{"line_number":36,"context_line":"    except OperationalError as e:"},{"line_number":37,"context_line":"        logger.error(e)"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"    try:"},{"line_number":40,"context_line":"        guest_agent_version \u003d Column(\u0027guest_agent_version\u0027, String(255))"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAWH%2F%2FBls%3D","line":37,"in_reply_to":"AAAAWH%2F%2FCYk%3D","updated":"2014-03-20 20:44:08.000000000","message":"Yep, this is to ignore the error for when an index already exists.","commit_id":"0a5f8c71bb0b8742471493fc6f27f3e52ebd6da5"},{"author":{"_account_id":8415,"name":"Denis M.","email":"lildee1991@gmail.com","username":"dmakogon"},"change_message_id":"d733e4e4ea7feec81118c22e7529ff50f128043a","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright 2014 OpenStack Foundation"},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"},{"line_number":4,"context_line":"#    not use this file except in compliance with the License. You may obtain"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAWH%2F9TUo%3D","line":1,"updated":"2014-04-07 09:07:31.000000000","message":"please use the same headers","commit_id":"ff96e3091d6f80030118dfe8c061578c03ed61c4"},{"author":{"_account_id":6162,"name":"Dan Nguyen","email":"dan.nguyens.mail@gmail.com","username":"daniel-a-nguyen"},"change_message_id":"0bd67fd403ce878cb9161697d3e491aaf83a8e4d","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright 2014 OpenStack Foundation"},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"},{"line_number":4,"context_line":"#    not use this file except in compliance with the License. You may obtain"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAW3%2F%2FwyY%3D","line":1,"in_reply_to":"AAAAWH%2F9TUo%3D","updated":"2014-04-23 17:52:27.000000000","message":"Done","commit_id":"ff96e3091d6f80030118dfe8c061578c03ed61c4"},{"author":{"_account_id":1925,"name":"Vipul Sabhaya","email":"vipuls@gmail.com","username":"vipuls"},"change_message_id":"afe0faaea07f82f31ec8ab928bbb50e2d62b14a6","unresolved":false,"context_lines":[{"line_number":38,"context_line":""},{"line_number":39,"context_line":"    try:"},{"line_number":40,"context_line":"        guest_agent_version \u003d Column(\u0027guest_agent_version\u0027, String(255))"},{"line_number":41,"context_line":"        agent_heartbeats.create_column(guest_agent_version)"},{"line_number":42,"context_line":"        guest_agent_version_idx \u003d Index(\"agent_heartbeats_guest_agent_version\","},{"line_number":43,"context_line":"                                        agent_heartbeats.c.guest_agent_version)"},{"line_number":44,"context_line":"        guest_agent_version_idx.create()"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAWH%2F9zyU%3D","line":41,"updated":"2014-04-02 00:55:21.000000000","message":"I thought we agreed that the version would go to the \u0027instances\u0027 table? http://eavesdrop.openstack.org/irclogs/%23openstack-trove/%23openstack-trove.2014-03-17.log\n\n2014-03-17T18:33:14","commit_id":"ff96e3091d6f80030118dfe8c061578c03ed61c4"},{"author":{"_account_id":6162,"name":"Dan Nguyen","email":"dan.nguyens.mail@gmail.com","username":"daniel-a-nguyen"},"change_message_id":"b86b38586eea67e6d2e342506b23584757d175be","unresolved":false,"context_lines":[{"line_number":38,"context_line":""},{"line_number":39,"context_line":"    try:"},{"line_number":40,"context_line":"        guest_agent_version \u003d Column(\u0027guest_agent_version\u0027, String(255))"},{"line_number":41,"context_line":"        agent_heartbeats.create_column(guest_agent_version)"},{"line_number":42,"context_line":"        guest_agent_version_idx \u003d Index(\"agent_heartbeats_guest_agent_version\","},{"line_number":43,"context_line":"                                        agent_heartbeats.c.guest_agent_version)"},{"line_number":44,"context_line":"        guest_agent_version_idx.create()"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAWH%2F9tFo%3D","line":41,"in_reply_to":"AAAAWH%2F9zyU%3D","updated":"2014-04-02 17:26:23.000000000","message":"I verified with hub_cap before starting this work.  \n\nSince we are updating with the same heartbeat it goes in the agent_heartbeats.  Also, we\u0027re going to be adding to the agent_heartbeats in the future.","commit_id":"ff96e3091d6f80030118dfe8c061578c03ed61c4"},{"author":{"_account_id":1925,"name":"Vipul Sabhaya","email":"vipuls@gmail.com","username":"vipuls"},"change_message_id":"289cfe16bed2159312367700fb57811e518ff389","unresolved":false,"context_lines":[{"line_number":36,"context_line":""},{"line_number":37,"context_line":"    try:"},{"line_number":38,"context_line":"        guest_agent_version \u003d Column(\u0027guest_agent_version\u0027, String(255))"},{"line_number":39,"context_line":"        agent_heartbeats.create_column(guest_agent_version)"},{"line_number":40,"context_line":"        guest_agent_version_idx \u003d Index(\"agent_heartbeats_guest_agent_version\","},{"line_number":41,"context_line":"                                        agent_heartbeats.c.guest_agent_version)"},{"line_number":42,"context_line":"        guest_agent_version_idx.create()"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAXH%2F%2FPog%3D","line":39,"updated":"2014-04-23 03:16:08.000000000","message":"We talked about adding a deleted column to this table.  Looks like you did in the previous patch set, but removed it again in this one?","commit_id":"8e7410249a862dbca7f408ef2a940546762f0249"},{"author":{"_account_id":6162,"name":"Dan Nguyen","email":"dan.nguyens.mail@gmail.com","username":"daniel-a-nguyen"},"change_message_id":"f2184bbcdaea2a4d1818b4bad24e81813662d86b","unresolved":false,"context_lines":[{"line_number":36,"context_line":""},{"line_number":37,"context_line":"    try:"},{"line_number":38,"context_line":"        guest_agent_version \u003d Column(\u0027guest_agent_version\u0027, String(255))"},{"line_number":39,"context_line":"        agent_heartbeats.create_column(guest_agent_version)"},{"line_number":40,"context_line":"        guest_agent_version_idx \u003d Index(\"agent_heartbeats_guest_agent_version\","},{"line_number":41,"context_line":"                                        agent_heartbeats.c.guest_agent_version)"},{"line_number":42,"context_line":"        guest_agent_version_idx.create()"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAXH%2F%2FKmQ%3D","line":39,"in_reply_to":"AAAAXH%2F%2FPog%3D","updated":"2014-04-23 17:51:26.000000000","message":"Don\u0027t know what happened here, added it back tho.","commit_id":"8e7410249a862dbca7f408ef2a940546762f0249"},{"author":{"_account_id":9683,"name":"Mat Lowery","email":"mlowery@ebaysf.com","username":"mat-lowery"},"change_message_id":"99ecb4c4c0159c0b222b35220a480aa7e6ea25ee","unresolved":false,"context_lines":[{"line_number":50,"context_line":"        agent_heartbeats.create_column(Column(\u0027deleted_at\u0027, DateTime()))"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"    except OperationalError as e:"},{"line_number":53,"context_line":"        logger.error(e)"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"def downgrade(migrate_engine):"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAXH%2F%2FIao%3D","line":53,"updated":"2014-04-23 20:17:45.000000000","message":"Any reason for the two try-except\u0027s? They both have the same Exception and same handling.","commit_id":"146d19a97798cecccc1ff270fe3f5ceffe99c1be"},{"author":{"_account_id":6162,"name":"Dan Nguyen","email":"dan.nguyens.mail@gmail.com","username":"daniel-a-nguyen"},"change_message_id":"6299cfe9b3a9536c416fc1540236c85f78fbbf90","unresolved":false,"context_lines":[{"line_number":50,"context_line":"        agent_heartbeats.create_column(Column(\u0027deleted_at\u0027, DateTime()))"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"    except OperationalError as e:"},{"line_number":53,"context_line":"        logger.error(e)"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"def downgrade(migrate_engine):"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAXH%2F%2FH58%3D","line":53,"in_reply_to":"AAAAXH%2F%2FIao%3D","updated":"2014-04-23 20:41:45.000000000","message":"Yep.  For the case of when an idx already exists it\u0027s okay to move onto create the other columns.\n\n(instance_id was already part of a previous schema change)","commit_id":"146d19a97798cecccc1ff270fe3f5ceffe99c1be"},{"author":{"_account_id":5293,"name":"Nikhil","email":"SlickNik@gmail.com","username":"slicknik"},"change_message_id":"9ff4b6d6ec4716cbf981a3b81bd7de6994a43b2b","unresolved":false,"context_lines":[{"line_number":65,"context_line":""},{"line_number":66,"context_line":"    guest_agent_version_idx \u003d Index(\"agent_heartbeats_guest_agent_version\","},{"line_number":67,"context_line":"                                    agent_heartbeats.c.guest_agent_version)"},{"line_number":68,"context_line":"    guest_agent_version_idx.drop()"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"    deleted_idx \u003d Index(\"agent_heartbeats_deleted\", agent_heartbeats.c.deleted)"},{"line_number":71,"context_line":"    deleted_idx.drop()"}],"source_content_type":"text/x-python","patch_set":23,"id":"AAAAXX%2F%2FyGA%3D","line":68,"updated":"2014-04-27 20:12:34.000000000","message":"Since you already dropped the column (guest_agent_version), and the column is the only column in the index, mysql will auto-delete the index for you. If you want to explicitly remove the index, ensure you do this before you drop the column, or else this will result in \"ERROR 1091 (42000): Can\u0027t DROP (index)\"\n\nMore details regarding this behavior can be found in the mysql reference manual at: http://dev.mysql.com/doc/refman/5.1/en/alter-table.html \n\nThe specific section that refers to this states:\n\"If columns are dropped from a table, the columns are also removed from any index of which they are a part. If all columns that make up an index are dropped, the index is dropped as well. If you use CHANGE or MODIFY to shorten a column for which an index exists on the column, and the resulting column length is less than the index length, MySQL shortens the index automatically. \"","commit_id":"d4c9a4579bec974d230265d068a41f2a2df8385b"},{"author":{"_account_id":6156,"name":"Justin Hopper","email":"justin.hopper@hp.com","username":"justin-hopper"},"change_message_id":"c61480b356b9860a874e42cf68a2c4b93d2df066","unresolved":false,"context_lines":[{"line_number":31,"context_line":"    try:"},{"line_number":32,"context_line":"        instance_id_idx \u003d Index(\"agent_heartbeats_instance_id\","},{"line_number":33,"context_line":"                                agent_heartbeats.c.instance_id)"},{"line_number":34,"context_line":"        instance_id_idx.create()"},{"line_number":35,"context_line":"    except OperationalError as e:"},{"line_number":36,"context_line":"        logger.error(e)"},{"line_number":37,"context_line":""}],"source_content_type":"text/x-python","patch_set":26,"id":"facab960_ab4a3925","line":34,"updated":"2014-04-28 21:58:12.000000000","message":"not only should this be an index (which is a good pre-emptive optimization). I think it should be unique.  If it is not unique status for this will get all sorts of messed up if someone accidentally creates more than heartbeat for the same instance.","commit_id":"4728e0ea02ddc21ee1014fe012782825e9c99985"},{"author":{"_account_id":5293,"name":"Nikhil","email":"SlickNik@gmail.com","username":"slicknik"},"change_message_id":"dd59baf2a5b888d045f30a6d42260f6e679c9ee5","unresolved":false,"context_lines":[{"line_number":73,"context_line":"    agent_heartbeats.drop_column(\u0027deleted\u0027)"},{"line_number":74,"context_line":"    agent_heartbeats.drop_column(\u0027deleted_at\u0027)"},{"line_number":75,"context_line":"    deleted_idx \u003d Index(\"agent_heartbeats_deleted\", agent_heartbeats.c.deleted)"},{"line_number":76,"context_line":"    deleted_idx.drop()"}],"source_content_type":"text/x-python","patch_set":28,"id":"9ad9bd40_fa684d23","line":76,"updated":"2014-05-02 07:33:35.000000000","message":"Same issue exists here with the deleted_idx.\n\nSince you already dropped the column (deleted), and the column is the only column in the index, mysql will auto-delete the index for you. If you want to explicitly remove the index, ensure you do this before you drop the column, or else this will result in \"ERROR 1091 (42000): Can\u0027t DROP (index)\"\n\nMore details regarding this behavior can be found in the mysql reference manual at: http://dev.mysql.com/doc/refman/5.1/en/alter-table.html\n\nThe specific section that refers to this states: \"If columns are dropped from a table, the columns are also removed from any index of which they are a part. If all columns that make up an index are dropped, the index is dropped as well. If you use CHANGE or MODIFY to shorten a column for which an index exists on the column, and the resulting column length is less than the index length, MySQL shortens the index automatically. \"","commit_id":"4f7b8311adf1954cde1fdc8d9d1f292605937dbf"},{"author":{"_account_id":4240,"name":"Craig Vyvial","email":"cp16net@gmail.com","username":"cp16net"},"change_message_id":"33180adcd870a0edb9737bc9559ee60dc827693d","unresolved":false,"context_lines":[{"line_number":33,"context_line":"                                agent_heartbeats.c.instance_id)"},{"line_number":34,"context_line":"        instance_id_idx.create()"},{"line_number":35,"context_line":"    except OperationalError as e:"},{"line_number":36,"context_line":"        logger.error(e)"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"    try:"},{"line_number":39,"context_line":"        guest_agent_version \u003d Column(\u0027guest_agent_version\u0027, String(255))"}],"source_content_type":"text/x-python","patch_set":31,"id":"9ad9bd40_864cde9f","line":36,"updated":"2014-05-07 06:12:43.000000000","message":"i am concerned that this just logs an error and doesnt raise the exception after finding it and make the script fail when there is an error.\n\nIs there a reason you are not raising the exception?","commit_id":"2ec69f5e439d94fe792b5925931832b77ddcce5d"},{"author":{"_account_id":6162,"name":"Dan Nguyen","email":"dan.nguyens.mail@gmail.com","username":"daniel-a-nguyen"},"change_message_id":"bee0b634861968f1928bc99ef45b4119b72ec813","unresolved":false,"context_lines":[{"line_number":33,"context_line":"                                agent_heartbeats.c.instance_id)"},{"line_number":34,"context_line":"        instance_id_idx.create()"},{"line_number":35,"context_line":"    except OperationalError as e:"},{"line_number":36,"context_line":"        logger.error(e)"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"    try:"},{"line_number":39,"context_line":"        guest_agent_version \u003d Column(\u0027guest_agent_version\u0027, String(255))"}],"source_content_type":"text/x-python","patch_set":31,"id":"7adec928_95302858","line":36,"in_reply_to":"9ad9bd40_864cde9f","updated":"2014-05-08 00:18:35.000000000","message":"Yeah, this is just incase the index already exists.\n\nThere doesn\u0027t seem to be an easy way to check if an index exists before creating it so I opted just wrap it in a try/except to allow the code below to execute anyway.","commit_id":"2ec69f5e439d94fe792b5925931832b77ddcce5d"}],"trove/db/sqlalchemy/migrate_repo/versions/026_recreate_agent_heartbeat.py":[{"author":{"_account_id":9746,"name":"Doug Shelley","email":"dougshelley66@gmail.com","username":"dougshelley"},"change_message_id":"a45e682783582e2348616f72fc340c66ef874a55","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright 2014 Hewlett-Packard Development Company, L.P."},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\");"},{"line_number":4,"context_line":"# you may not use this file except in compliance with the License."}],"source_content_type":"text/x-python","patch_set":40,"id":"7adec928_0a9238f6","line":1,"range":{"start_line":1,"start_character":16,"end_line":1,"end_character":17},"updated":"2014-05-21 02:32:13.000000000","message":"A change just got committed which adds a 026_.. I presume that means you should change this to 027?","commit_id":"6ad459c93f7012f02e3513f0e52cf3e72899e1af"},{"author":{"_account_id":6162,"name":"Dan Nguyen","email":"dan.nguyens.mail@gmail.com","username":"daniel-a-nguyen"},"change_message_id":"77dc536db60b14d7d68f65e3705272ebf5b3a8d4","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright 2014 Hewlett-Packard Development Company, L.P."},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\");"},{"line_number":4,"context_line":"# you may not use this file except in compliance with the License."}],"source_content_type":"text/x-python","patch_set":40,"id":"7adec928_3f5abc50","line":1,"in_reply_to":"7adec928_0a9238f6","updated":"2014-05-21 19:30:08.000000000","message":"yep, you are correct.  I\u0027ll bump up the number. thx!","commit_id":"6ad459c93f7012f02e3513f0e52cf3e72899e1af"}],"trove/db/sqlalchemy/migrate_repo/versions/027_recreate_agent_heartbeat.py":[{"author":{"_account_id":8214,"name":"Auston McReynolds","email":"amcreynolds@ebaysf.com","username":"amcreynolds"},"change_message_id":"f2f57a85fbeabc45aea119711d5d76d99531f09a","unresolved":false,"context_lines":[{"line_number":40,"context_line":"        Column(\u0027guest_agent_version\u0027, String(255), index\u003dTrue),"},{"line_number":41,"context_line":"        Column(\u0027deleted\u0027, Boolean(), index\u003dTrue),"},{"line_number":42,"context_line":"        Column(\u0027deleted_at\u0027, DateTime()),"},{"line_number":43,"context_line":"        Column(\u0027updated_at\u0027, DateTime()))"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"    # original table from migration 005_heartbeat.py"},{"line_number":46,"context_line":"    previous_agent_heartbeats \u003d Table(\u0027agent_heartbeats\u0027, meta, autoload\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":42,"id":"1ae5cdf2_b2d798ec","line":43,"updated":"2014-06-03 06:11:10.000000000","message":"updated_at should be nullable\u003dFalse because upon insertion, it should and will be set.","commit_id":"21bd3f20d45c863557f738dedcd4928b8f1a7e32"}],"trove/guestagent/models.py":[{"author":{"_account_id":1925,"name":"Vipul Sabhaya","email":"vipuls@gmail.com","username":"vipuls"},"change_message_id":"afe0faaea07f82f31ec8ab928bbb50e2d62b14a6","unresolved":false,"context_lines":[{"line_number":37,"context_line":"class AgentHeartBeat(dbmodels.DatabaseModelBase):"},{"line_number":38,"context_line":"    \"\"\"Defines the state of a Guest Agent.\"\"\""},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    _data_fields \u003d [\u0027instance_id\u0027, \u0027updated_at\u0027, \u0027guest_agent_version\u0027]"},{"line_number":41,"context_line":"    _table_name \u003d \u0027agent_heartbeats\u0027"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"    def __init__(self, **kwargs):"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAWH%2F9zpM%3D","line":40,"updated":"2014-04-02 00:55:21.000000000","message":"Again, the version should go into the instances table.\n\nSo it seems nothing today actually populates this table, however we have it in the schema.  I didn\u0027t realize that this existed, i guess it would be good to know what the original intent was for having this table.\n\nOne other issue I have with putting this model here is that it introduces a bunch of sqlalchemy to the guest agent.  Although the guest today doesn\u0027t actually instantiate this, it makes it too easy for someone to sneak a patch in that uses this model.","commit_id":"ff96e3091d6f80030118dfe8c061578c03ed61c4"},{"author":{"_account_id":6162,"name":"Dan Nguyen","email":"dan.nguyens.mail@gmail.com","username":"daniel-a-nguyen"},"change_message_id":"0bd67fd403ce878cb9161697d3e491aaf83a8e4d","unresolved":false,"context_lines":[{"line_number":37,"context_line":"class AgentHeartBeat(dbmodels.DatabaseModelBase):"},{"line_number":38,"context_line":"    \"\"\"Defines the state of a Guest Agent.\"\"\""},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    _data_fields \u003d [\u0027instance_id\u0027, \u0027updated_at\u0027, \u0027guest_agent_version\u0027]"},{"line_number":41,"context_line":"    _table_name \u003d \u0027agent_heartbeats\u0027"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"    def __init__(self, **kwargs):"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAW3%2F%2Fwz8%3D","line":40,"in_reply_to":"AAAAWH%2F9OGg%3D","updated":"2014-04-23 17:52:27.000000000","message":"I think this issue is more in line with the desire to move all DAO code outside of the guest agent to prevent direct access to the control plane DB.\n\nThat could be done in a different patch and was not scoped as a requirement for the work being done here.","commit_id":"ff96e3091d6f80030118dfe8c061578c03ed61c4"},{"author":{"_account_id":1925,"name":"Vipul Sabhaya","email":"vipuls@gmail.com","username":"vipuls"},"change_message_id":"e9f684c3e83e54f8849815b86f055540cfadf4e4","unresolved":false,"context_lines":[{"line_number":37,"context_line":"class AgentHeartBeat(dbmodels.DatabaseModelBase):"},{"line_number":38,"context_line":"    \"\"\"Defines the state of a Guest Agent.\"\"\""},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    _data_fields \u003d [\u0027instance_id\u0027, \u0027updated_at\u0027, \u0027guest_agent_version\u0027]"},{"line_number":41,"context_line":"    _table_name \u003d \u0027agent_heartbeats\u0027"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"    def __init__(self, **kwargs):"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAWH%2F9OGg%3D","line":40,"in_reply_to":"AAAAWH%2F9tDs%3D","updated":"2014-04-07 21:10:55.000000000","message":"I think what i am proposing is that this class/module needs to me moved out from trove/guestagent completely, and somewhere else.  I.e. When the guest moves to its own repository, this class should not go with.\n\nIn the event that it is actually used by GuestAgent code, it makes sqlalchemy a requirement.","commit_id":"ff96e3091d6f80030118dfe8c061578c03ed61c4"},{"author":{"_account_id":6162,"name":"Dan Nguyen","email":"dan.nguyens.mail@gmail.com","username":"daniel-a-nguyen"},"change_message_id":"b86b38586eea67e6d2e342506b23584757d175be","unresolved":false,"context_lines":[{"line_number":37,"context_line":"class AgentHeartBeat(dbmodels.DatabaseModelBase):"},{"line_number":38,"context_line":"    \"\"\"Defines the state of a Guest Agent.\"\"\""},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    _data_fields \u003d [\u0027instance_id\u0027, \u0027updated_at\u0027, \u0027guest_agent_version\u0027]"},{"line_number":41,"context_line":"    _table_name \u003d \u0027agent_heartbeats\u0027"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"    def __init__(self, **kwargs):"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAWH%2F9tDs%3D","line":40,"in_reply_to":"AAAAWH%2F9zpM%3D","updated":"2014-04-02 17:26:23.000000000","message":"See my previous comment regarding where the versions live.\n\nThis patch is the parent patch to another one I\u0027m working on that will make use of this table/column.  I split it up to make it easier to review.\n\nIf someone were to \u0027sneak\u0027 in a patch to populate this column without a valid bp or bug then I think core should catch that.","commit_id":"ff96e3091d6f80030118dfe8c061578c03ed61c4"},{"author":{"_account_id":9683,"name":"Mat Lowery","email":"mlowery@ebaysf.com","username":"mat-lowery"},"change_message_id":"99ecb4c4c0159c0b222b35220a480aa7e6ea25ee","unresolved":false,"context_lines":[{"line_number":62,"context_line":""},{"line_number":63,"context_line":"    @classmethod"},{"line_number":64,"context_line":"    def find_all_by_version(cls, guest_agent_version):"},{"line_number":65,"context_line":"        heartbeat \u003d None"},{"line_number":66,"context_line":"        try:"},{"line_number":67,"context_line":"            if guest_agent_version is not None:"},{"line_number":68,"context_line":"                heartbeat \u003d cls.find_all("}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAXH%2F%2FIVQ%3D","line":65,"updated":"2014-04-23 20:17:45.000000000","message":"I assume find_all_* means that multiple records are allowed. If so, why the singular \"heartbeat\" as opposed to \"heartbeats\"?","commit_id":"146d19a97798cecccc1ff270fe3f5ceffe99c1be"},{"author":{"_account_id":6162,"name":"Dan Nguyen","email":"dan.nguyens.mail@gmail.com","username":"daniel-a-nguyen"},"change_message_id":"6299cfe9b3a9536c416fc1540236c85f78fbbf90","unresolved":false,"context_lines":[{"line_number":62,"context_line":""},{"line_number":63,"context_line":"    @classmethod"},{"line_number":64,"context_line":"    def find_all_by_version(cls, guest_agent_version):"},{"line_number":65,"context_line":"        heartbeat \u003d None"},{"line_number":66,"context_line":"        try:"},{"line_number":67,"context_line":"            if guest_agent_version is not None:"},{"line_number":68,"context_line":"                heartbeat \u003d cls.find_all("}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAXH%2F%2FH5Y%3D","line":65,"in_reply_to":"AAAAXH%2F%2FIVQ%3D","updated":"2014-04-23 20:41:45.000000000","message":"sure, I can make it heartbeats with an \u0027s\u0027","commit_id":"146d19a97798cecccc1ff270fe3f5ceffe99c1be"},{"author":{"_account_id":9683,"name":"Mat Lowery","email":"mlowery@ebaysf.com","username":"mat-lowery"},"change_message_id":"99ecb4c4c0159c0b222b35220a480aa7e6ea25ee","unresolved":false,"context_lines":[{"line_number":64,"context_line":"    def find_all_by_version(cls, guest_agent_version):"},{"line_number":65,"context_line":"        heartbeat \u003d None"},{"line_number":66,"context_line":"        try:"},{"line_number":67,"context_line":"            if guest_agent_version is not None:"},{"line_number":68,"context_line":"                heartbeat \u003d cls.find_all("},{"line_number":69,"context_line":"                    guest_agent_version\u003dguest_agent_version, deleted\u003d0)"},{"line_number":70,"context_line":"        except exception.NotFound as e:"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAXH%2F%2FIQc%3D","line":67,"updated":"2014-04-23 20:17:45.000000000","message":"I think it\u0027s more Pythonic to do:\n\n    if not guest_agent_version:","commit_id":"146d19a97798cecccc1ff270fe3f5ceffe99c1be"},{"author":{"_account_id":6162,"name":"Dan Nguyen","email":"dan.nguyens.mail@gmail.com","username":"daniel-a-nguyen"},"change_message_id":"f79e36341b0a6a481790320b6f0d2f93b6bc4772","unresolved":false,"context_lines":[{"line_number":64,"context_line":"    def find_all_by_version(cls, guest_agent_version):"},{"line_number":65,"context_line":"        heartbeat \u003d None"},{"line_number":66,"context_line":"        try:"},{"line_number":67,"context_line":"            if guest_agent_version is not None:"},{"line_number":68,"context_line":"                heartbeat \u003d cls.find_all("},{"line_number":69,"context_line":"                    guest_agent_version\u003dguest_agent_version, deleted\u003d0)"},{"line_number":70,"context_line":"        except exception.NotFound as e:"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAXH%2F%2FHtg%3D","line":67,"in_reply_to":"AAAAXH%2F%2FIQc%3D","updated":"2014-04-23 21:33:04.000000000","message":"k","commit_id":"146d19a97798cecccc1ff270fe3f5ceffe99c1be"},{"author":{"_account_id":9683,"name":"Mat Lowery","email":"mlowery@ebaysf.com","username":"mat-lowery"},"change_message_id":"99ecb4c4c0159c0b222b35220a480aa7e6ea25ee","unresolved":false,"context_lines":[{"line_number":70,"context_line":"        except exception.NotFound as e:"},{"line_number":71,"context_line":"            LOG.error(e.message)"},{"line_number":72,"context_line":"            raise exception.NotFound(guest_agent_version\u003dguest_agent_version)"},{"line_number":73,"context_line":"        return heartbeat"},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"    @classmethod"},{"line_number":76,"context_line":"    def find_by_instance_id(cls, instance_id):"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAXH%2F%2FINE%3D","line":73,"updated":"2014-04-23 20:17:45.000000000","message":"In normal circumstances, the caller either gets a non-None collection or an exception. Now there\u0027s a third option: None. (If a caller passes in guest_agent_version\u003dNone then he gets None back.) In order to avoid None as a return value, would it be better to raise an exception when guest_agent_version\u003dNone? In other words, treat guest_agent_version\u003dNone as caller error.","commit_id":"146d19a97798cecccc1ff270fe3f5ceffe99c1be"},{"author":{"_account_id":9683,"name":"Mat Lowery","email":"mlowery@ebaysf.com","username":"mat-lowery"},"change_message_id":"99ecb4c4c0159c0b222b35220a480aa7e6ea25ee","unresolved":false,"context_lines":[{"line_number":74,"context_line":""},{"line_number":75,"context_line":"    @classmethod"},{"line_number":76,"context_line":"    def find_by_instance_id(cls, instance_id):"},{"line_number":77,"context_line":"        heartbeats \u003d None"},{"line_number":78,"context_line":"        try:"},{"line_number":79,"context_line":"            if instance_id is not None:"},{"line_number":80,"context_line":"                heartbeats \u003d cls.find_by(instance_id\u003dinstance_id)"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAXH%2F%2FIS0%3D","line":77,"updated":"2014-04-23 20:17:45.000000000","message":"If this method returns a None or a non-collection, then why the plural \"heartbeats\"?","commit_id":"146d19a97798cecccc1ff270fe3f5ceffe99c1be"},{"author":{"_account_id":9683,"name":"Mat Lowery","email":"mlowery@ebaysf.com","username":"mat-lowery"},"change_message_id":"99ecb4c4c0159c0b222b35220a480aa7e6ea25ee","unresolved":false,"context_lines":[{"line_number":76,"context_line":"    def find_by_instance_id(cls, instance_id):"},{"line_number":77,"context_line":"        heartbeats \u003d None"},{"line_number":78,"context_line":"        try:"},{"line_number":79,"context_line":"            if instance_id is not None:"},{"line_number":80,"context_line":"                heartbeats \u003d cls.find_by(instance_id\u003dinstance_id)"},{"line_number":81,"context_line":"        except exception.NotFound as e:"},{"line_number":82,"context_line":"            LOG.error(e.message)"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAXH%2F%2FIFo%3D","line":79,"updated":"2014-04-23 20:17:45.000000000","message":"Same as line 67.","commit_id":"146d19a97798cecccc1ff270fe3f5ceffe99c1be"},{"author":{"_account_id":9683,"name":"Mat Lowery","email":"mlowery@ebaysf.com","username":"mat-lowery"},"change_message_id":"99ecb4c4c0159c0b222b35220a480aa7e6ea25ee","unresolved":false,"context_lines":[{"line_number":81,"context_line":"        except exception.NotFound as e:"},{"line_number":82,"context_line":"            LOG.error(e.message)"},{"line_number":83,"context_line":"            raise exception.NotFound(instance_id\u003dinstance_id)"},{"line_number":84,"context_line":"        return heartbeats"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"    @staticmethod"},{"line_number":87,"context_line":"    def is_active(agent):"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAXH%2F%2FIMg%3D","line":84,"updated":"2014-04-23 20:17:45.000000000","message":"Same as line 73.","commit_id":"146d19a97798cecccc1ff270fe3f5ceffe99c1be"},{"author":{"_account_id":6156,"name":"Justin Hopper","email":"justin.hopper@hp.com","username":"justin-hopper"},"change_message_id":"0a8fa647abdd86499b19fdc9e7b7802ac0598e96","unresolved":false,"context_lines":[{"line_number":57,"context_line":"            raise exception.InvalidModelError(errors\u003dself.errors)"},{"line_number":58,"context_line":"        self[\u0027updated_at\u0027] \u003d utils.utcnow()"},{"line_number":59,"context_line":"        LOG.debug(_(\"Saving %(name)s: %(dict)s\") %"},{"line_number":60,"context_line":"                  {\u0027name\u0027: self.__class__.__name__, \u0027dict\u0027: self.__dict__})"},{"line_number":61,"context_line":"        return get_db_api().save(self)"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"    @classmethod"}],"source_content_type":"text/x-python","patch_set":24,"id":"3a1371a2_8a646fe6","line":60,"updated":"2014-04-28 20:12:11.000000000","message":"This method looks identical to the method in the parent class.  If so, then it should be deleted","commit_id":"d05c7bc2227ca78b5e2427ca4a15708dcd7cc5da"},{"author":{"_account_id":4240,"name":"Craig Vyvial","email":"cp16net@gmail.com","username":"cp16net"},"change_message_id":"22d5207ba1e856b98f7f633778f0166f793f40f4","unresolved":false,"context_lines":[{"line_number":62,"context_line":"    @classmethod"},{"line_number":63,"context_line":"    def find_all_by_version(cls, guest_agent_version, deleted\u003d0):"},{"line_number":64,"context_line":"        try:"},{"line_number":65,"context_line":"            if guest_agent_version:"},{"line_number":66,"context_line":"                return cls.find_all("},{"line_number":67,"context_line":"                    guest_agent_version\u003dguest_agent_version, deleted\u003ddeleted)"},{"line_number":68,"context_line":"        except exception.NotFound as e:"}],"source_content_type":"text/x-python","patch_set":42,"id":"1ae5cdf2_892197fd","line":65,"updated":"2014-06-03 03:46:01.000000000","message":"This would return None in the else case and the calls are not checking for None but this should probably raise the NotFound Exception.\n\nCould you also add a test for this corner case plz?","commit_id":"21bd3f20d45c863557f738dedcd4928b8f1a7e32"},{"author":{"_account_id":8214,"name":"Auston McReynolds","email":"amcreynolds@ebaysf.com","username":"amcreynolds"},"change_message_id":"f2f57a85fbeabc45aea119711d5d76d99531f09a","unresolved":false,"context_lines":[{"line_number":62,"context_line":"    @classmethod"},{"line_number":63,"context_line":"    def find_all_by_version(cls, guest_agent_version, deleted\u003d0):"},{"line_number":64,"context_line":"        try:"},{"line_number":65,"context_line":"            if guest_agent_version:"},{"line_number":66,"context_line":"                return cls.find_all("},{"line_number":67,"context_line":"                    guest_agent_version\u003dguest_agent_version, deleted\u003ddeleted)"},{"line_number":68,"context_line":"        except exception.NotFound as e:"}],"source_content_type":"text/x-python","patch_set":42,"id":"1ae5cdf2_924a9cc3","line":65,"in_reply_to":"1ae5cdf2_892197fd","updated":"2014-06-03 06:11:10.000000000","message":"agreed on both fronts. also, why not ModelNotFound?","commit_id":"21bd3f20d45c863557f738dedcd4928b8f1a7e32"},{"author":{"_account_id":4240,"name":"Craig Vyvial","email":"cp16net@gmail.com","username":"cp16net"},"change_message_id":"22d5207ba1e856b98f7f633778f0166f793f40f4","unresolved":false,"context_lines":[{"line_number":72,"context_line":"    @classmethod"},{"line_number":73,"context_line":"    def find_by_instance_id(cls, instance_id):"},{"line_number":74,"context_line":"        try:"},{"line_number":75,"context_line":"            if instance_id:"},{"line_number":76,"context_line":"                return cls.find_by(instance_id\u003dinstance_id)"},{"line_number":77,"context_line":"        except exception.NotFound as e:"},{"line_number":78,"context_line":"            LOG.error(e.message)"}],"source_content_type":"text/x-python","patch_set":42,"id":"1ae5cdf2_e964db4a","line":75,"updated":"2014-06-03 03:46:01.000000000","message":"same as above.","commit_id":"21bd3f20d45c863557f738dedcd4928b8f1a7e32"},{"author":{"_account_id":8214,"name":"Auston McReynolds","email":"amcreynolds@ebaysf.com","username":"amcreynolds"},"change_message_id":"f2f57a85fbeabc45aea119711d5d76d99531f09a","unresolved":false,"context_lines":[{"line_number":72,"context_line":"    @classmethod"},{"line_number":73,"context_line":"    def find_by_instance_id(cls, instance_id):"},{"line_number":74,"context_line":"        try:"},{"line_number":75,"context_line":"            if instance_id:"},{"line_number":76,"context_line":"                return cls.find_by(instance_id\u003dinstance_id)"},{"line_number":77,"context_line":"        except exception.NotFound as e:"},{"line_number":78,"context_line":"            LOG.error(e.message)"}],"source_content_type":"text/x-python","patch_set":42,"id":"1ae5cdf2_f21680a6","line":75,"in_reply_to":"1ae5cdf2_e964db4a","updated":"2014-06-03 06:11:10.000000000","message":"agreed (and see above)","commit_id":"21bd3f20d45c863557f738dedcd4928b8f1a7e32"}],"trove/instance/models.py":[{"author":{"_account_id":1925,"name":"Vipul Sabhaya","email":"vipuls@gmail.com","username":"vipuls"},"change_message_id":"9e115b19e06f75a186ca144a16d725d1b2092a41","unresolved":false,"context_lines":[{"line_number":506,"context_line":"            self.update_db(task_status\u003dInstanceTasks.DELETING,"},{"line_number":507,"context_line":"                           configuration_id\u003dNone)"},{"line_number":508,"context_line":"            task_api.API(self.context).delete_instance(self.id)"},{"line_number":509,"context_line":"            agent_models.AgentHeartBeat.delete()"},{"line_number":510,"context_line":"        deltas \u003d {\u0027instances\u0027: -1}"},{"line_number":511,"context_line":"        if CONF.trove_volume_support:"},{"line_number":512,"context_line":"            deltas[\u0027volumes\u0027] \u003d -self.volume_size"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAXH%2F%2FI0Q%3D","line":509,"updated":"2014-04-23 18:50:03.000000000","message":"You need to load the actual AgentHeartbeat record before you can call delete on it.","commit_id":"da2c2e3639078a4a73bfdfec1603a977cae02943"},{"author":{"_account_id":9683,"name":"Mat Lowery","email":"mlowery@ebaysf.com","username":"mat-lowery"},"change_message_id":"99ecb4c4c0159c0b222b35220a480aa7e6ea25ee","unresolved":false,"context_lines":[{"line_number":506,"context_line":"            self.update_db(task_status\u003dInstanceTasks.DELETING,"},{"line_number":507,"context_line":"                           configuration_id\u003dNone)"},{"line_number":508,"context_line":"            task_api.API(self.context).delete_instance(self.id)"},{"line_number":509,"context_line":"            agent_models.AgentHeartBeat().delete()"},{"line_number":510,"context_line":"        deltas \u003d {\u0027instances\u0027: -1}"},{"line_number":511,"context_line":"        if CONF.trove_volume_support:"},{"line_number":512,"context_line":"            deltas[\u0027volumes\u0027] \u003d -self.volume_size"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAXH%2F%2FILI%3D","line":509,"updated":"2014-04-23 20:17:45.000000000","message":"In Patch Set 14, Vipul asked about this line. I see you\u0027re now instantiating the class. But I still don\u0027t see where the id is coming from so that it knows what to delete.","commit_id":"146d19a97798cecccc1ff270fe3f5ceffe99c1be"},{"author":{"_account_id":6162,"name":"Dan Nguyen","email":"dan.nguyens.mail@gmail.com","username":"daniel-a-nguyen"},"change_message_id":"6299cfe9b3a9536c416fc1540236c85f78fbbf90","unresolved":false,"context_lines":[{"line_number":506,"context_line":"            self.update_db(task_status\u003dInstanceTasks.DELETING,"},{"line_number":507,"context_line":"                           configuration_id\u003dNone)"},{"line_number":508,"context_line":"            task_api.API(self.context).delete_instance(self.id)"},{"line_number":509,"context_line":"            agent_models.AgentHeartBeat().delete()"},{"line_number":510,"context_line":"        deltas \u003d {\u0027instances\u0027: -1}"},{"line_number":511,"context_line":"        if CONF.trove_volume_support:"},{"line_number":512,"context_line":"            deltas[\u0027volumes\u0027] \u003d -self.volume_size"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAXH%2F%2FH7c%3D","line":509,"in_reply_to":"AAAAXH%2F%2FILI%3D","updated":"2014-04-23 20:41:45.000000000","message":"yep, sorry about that, probably need to load it with the id first.\n\nGood catch.","commit_id":"146d19a97798cecccc1ff270fe3f5ceffe99c1be"},{"author":{"_account_id":6156,"name":"Justin Hopper","email":"justin.hopper@hp.com","username":"justin-hopper"},"change_message_id":"0a8fa647abdd86499b19fdc9e7b7802ac0598e96","unresolved":false,"context_lines":[{"line_number":513,"context_line":"                for h in heartbeats:"},{"line_number":514,"context_line":"                    h.delete()"},{"line_number":515,"context_line":"            except exception.NotFound as e:"},{"line_number":516,"context_line":"                LOG.error(e.message)"},{"line_number":517,"context_line":""},{"line_number":518,"context_line":"        deltas \u003d {\u0027instances\u0027: -1}"},{"line_number":519,"context_line":"        if CONF.trove_volume_support:"}],"source_content_type":"text/x-python","patch_set":24,"id":"3a1371a2_ea61a3d4","line":516,"updated":"2014-04-28 20:12:11.000000000","message":"just to prevent this method from growing much more, could this be extracted to a method called _delete_heartbeats()","commit_id":"d05c7bc2227ca78b5e2427ca4a15708dcd7cc5da"},{"author":{"_account_id":4240,"name":"Craig Vyvial","email":"cp16net@gmail.com","username":"cp16net"},"change_message_id":"33180adcd870a0edb9737bc9559ee60dc827693d","unresolved":false,"context_lines":[{"line_number":522,"context_line":"            for h in heartbeats:"},{"line_number":523,"context_line":"                h.delete()"},{"line_number":524,"context_line":"        except exception.NotFound as e:"},{"line_number":525,"context_line":"            LOG.error(e.message)"},{"line_number":526,"context_line":""},{"line_number":527,"context_line":"    def _delete_resources(self, deleted_at):"},{"line_number":528,"context_line":"        # Implemented in subclass"}],"source_content_type":"text/x-python","patch_set":31,"id":"9ad9bd40_912df697","line":525,"updated":"2014-05-07 06:12:43.000000000","message":"i think the reason you are not raising an exception is because we have already called the taskmanager to remove delete the instance. This makes me wonder if we should have this in the delete resources in taskmanager instead?","commit_id":"2ec69f5e439d94fe792b5925931832b77ddcce5d"},{"author":{"_account_id":6162,"name":"Dan Nguyen","email":"dan.nguyens.mail@gmail.com","username":"daniel-a-nguyen"},"change_message_id":"0212d0e1c9345582554a6ba771cbe958047cfda7","unresolved":false,"context_lines":[{"line_number":522,"context_line":"            for h in heartbeats:"},{"line_number":523,"context_line":"                h.delete()"},{"line_number":524,"context_line":"        except exception.NotFound as e:"},{"line_number":525,"context_line":"            LOG.error(e.message)"},{"line_number":526,"context_line":""},{"line_number":527,"context_line":"    def _delete_resources(self, deleted_at):"},{"line_number":528,"context_line":"        # Implemented in subclass"}],"source_content_type":"text/x-python","patch_set":31,"id":"7adec928_e0cd2888","line":525,"in_reply_to":"7adec928_b5d1a4cf","updated":"2014-05-08 23:01:24.000000000","message":"So I think I understand what you mean.  I can put the _delete helper in the task_api.API class","commit_id":"2ec69f5e439d94fe792b5925931832b77ddcce5d"},{"author":{"_account_id":6162,"name":"Dan Nguyen","email":"dan.nguyens.mail@gmail.com","username":"daniel-a-nguyen"},"change_message_id":"bee0b634861968f1928bc99ef45b4119b72ec813","unresolved":false,"context_lines":[{"line_number":522,"context_line":"            for h in heartbeats:"},{"line_number":523,"context_line":"                h.delete()"},{"line_number":524,"context_line":"        except exception.NotFound as e:"},{"line_number":525,"context_line":"            LOG.error(e.message)"},{"line_number":526,"context_line":""},{"line_number":527,"context_line":"    def _delete_resources(self, deleted_at):"},{"line_number":528,"context_line":"        # Implemented in subclass"}],"source_content_type":"text/x-python","patch_set":31,"id":"7adec928_b5d1a4cf","line":525,"in_reply_to":"9ad9bd40_912df697","updated":"2014-05-08 00:18:35.000000000","message":"We could let this bubble up if you want but I think I put it here because the way I wrote the \u0027find\u0027 method to raise if the query doesn\u0027t return a result.","commit_id":"2ec69f5e439d94fe792b5925931832b77ddcce5d"}],"trove/taskmanager/api.py":[{"author":{"_account_id":8214,"name":"Auston McReynolds","email":"amcreynolds@ebaysf.com","username":"amcreynolds"},"change_message_id":"2cfb9203dd024d2c3522530582b4710134c4182a","unresolved":false,"context_lines":[{"line_number":57,"context_line":"    def _delete_heartbeats(self, instance_id):"},{"line_number":58,"context_line":"        agent_heart_beat \u003d agent_models.AgentHeartBeat()"},{"line_number":59,"context_line":"        try:"},{"line_number":60,"context_line":"            heartbeats \u003d agent_heart_beat.find_by_instance_id(instance_id)"},{"line_number":61,"context_line":"            for h in heartbeats:"},{"line_number":62,"context_line":"                h.delete()"},{"line_number":63,"context_line":"        except exception.NotFound as e:"}],"source_content_type":"text/x-python","patch_set":35,"id":"7adec928_56a68a11","line":60,"updated":"2014-05-09 01:05:53.000000000","message":"maybe i\u0027m just tired, but if the new table has instance_id as unique\u003dTrue, how is it possible that there are multiple records here?","commit_id":"abf3842ccae2fdc4d03b995c5816e97ee485e37e"},{"author":{"_account_id":8214,"name":"Auston McReynolds","email":"amcreynolds@ebaysf.com","username":"amcreynolds"},"change_message_id":"e14d12d74a5d4c92ea42677a3ecd0131c31d5552","unresolved":false,"context_lines":[{"line_number":57,"context_line":"    def _delete_heartbeats(self, instance_id):"},{"line_number":58,"context_line":"        agent_heart_beat \u003d agent_models.AgentHeartBeat()"},{"line_number":59,"context_line":"        try:"},{"line_number":60,"context_line":"            heartbeats \u003d agent_heart_beat.find_by_instance_id(instance_id)"},{"line_number":61,"context_line":"            for h in heartbeats:"},{"line_number":62,"context_line":"                h.delete()"},{"line_number":63,"context_line":"        except exception.NotFound as e:"}],"source_content_type":"text/x-python","patch_set":35,"id":"7adec928_96965293","line":60,"in_reply_to":"7adec928_56a68a11","updated":"2014-05-09 01:06:51.000000000","message":"note: if i\u0027m correct, the function name should be changed to _delete_heartbeat (non-plural)","commit_id":"abf3842ccae2fdc4d03b995c5816e97ee485e37e"},{"author":{"_account_id":6162,"name":"Dan Nguyen","email":"dan.nguyens.mail@gmail.com","username":"daniel-a-nguyen"},"change_message_id":"83aeb40a7d9fe29622f6bfbc7eb368d089e986e6","unresolved":false,"context_lines":[{"line_number":57,"context_line":"    def _delete_heartbeats(self, instance_id):"},{"line_number":58,"context_line":"        agent_heart_beat \u003d agent_models.AgentHeartBeat()"},{"line_number":59,"context_line":"        try:"},{"line_number":60,"context_line":"            heartbeats \u003d agent_heart_beat.find_by_instance_id(instance_id)"},{"line_number":61,"context_line":"            for h in heartbeats:"},{"line_number":62,"context_line":"                h.delete()"},{"line_number":63,"context_line":"        except exception.NotFound as e:"}],"source_content_type":"text/x-python","patch_set":35,"id":"7adec928_161322b9","line":60,"in_reply_to":"7adec928_56a68a11","updated":"2014-05-09 01:41:47.000000000","message":"you are correct!","commit_id":"abf3842ccae2fdc4d03b995c5816e97ee485e37e"},{"author":{"_account_id":6162,"name":"Dan Nguyen","email":"dan.nguyens.mail@gmail.com","username":"daniel-a-nguyen"},"change_message_id":"83aeb40a7d9fe29622f6bfbc7eb368d089e986e6","unresolved":false,"context_lines":[{"line_number":57,"context_line":"    def _delete_heartbeats(self, instance_id):"},{"line_number":58,"context_line":"        agent_heart_beat \u003d agent_models.AgentHeartBeat()"},{"line_number":59,"context_line":"        try:"},{"line_number":60,"context_line":"            heartbeats \u003d agent_heart_beat.find_by_instance_id(instance_id)"},{"line_number":61,"context_line":"            for h in heartbeats:"},{"line_number":62,"context_line":"                h.delete()"},{"line_number":63,"context_line":"        except exception.NotFound as e:"}],"source_content_type":"text/x-python","patch_set":35,"id":"7adec928_96265215","line":60,"in_reply_to":"7adec928_96965293","updated":"2014-05-09 01:41:47.000000000","message":"will rename now, as well as fix whatever broke the tests","commit_id":"abf3842ccae2fdc4d03b995c5816e97ee485e37e"},{"author":{"_account_id":4240,"name":"Craig Vyvial","email":"cp16net@gmail.com","username":"cp16net"},"change_message_id":"22d5207ba1e856b98f7f633778f0166f793f40f4","unresolved":false,"context_lines":[{"line_number":56,"context_line":"    def _delete_heartbeat(self, instance_id):"},{"line_number":57,"context_line":"        agent_heart_beat \u003d agent_models.AgentHeartBeat()"},{"line_number":58,"context_line":"        try:"},{"line_number":59,"context_line":"            heartbeat \u003d agent_heart_beat.find_by_instance_id(instance_id)"},{"line_number":60,"context_line":"            heartbeat.delete()"},{"line_number":61,"context_line":"        except exception.NotFound as e:"},{"line_number":62,"context_line":"            LOG.error(e.message)"}],"source_content_type":"text/x-python","patch_set":42,"id":"1ae5cdf2_49dcefe4","line":59,"updated":"2014-06-03 03:46:01.000000000","message":"What if the instance_id is None then the heartbeat is None and the delete will fail with a Nonetype error.","commit_id":"21bd3f20d45c863557f738dedcd4928b8f1a7e32"},{"author":{"_account_id":8214,"name":"Auston McReynolds","email":"amcreynolds@ebaysf.com","username":"amcreynolds"},"change_message_id":"f2f57a85fbeabc45aea119711d5d76d99531f09a","unresolved":false,"context_lines":[{"line_number":56,"context_line":"    def _delete_heartbeat(self, instance_id):"},{"line_number":57,"context_line":"        agent_heart_beat \u003d agent_models.AgentHeartBeat()"},{"line_number":58,"context_line":"        try:"},{"line_number":59,"context_line":"            heartbeat \u003d agent_heart_beat.find_by_instance_id(instance_id)"},{"line_number":60,"context_line":"            heartbeat.delete()"},{"line_number":61,"context_line":"        except exception.NotFound as e:"},{"line_number":62,"context_line":"            LOG.error(e.message)"}],"source_content_type":"text/x-python","patch_set":42,"id":"1ae5cdf2_d27a64f0","line":59,"in_reply_to":"1ae5cdf2_49dcefe4","updated":"2014-06-03 06:11:10.000000000","message":"if the fixes in models.py are done, this is a non-issue, but good catch.","commit_id":"21bd3f20d45c863557f738dedcd4928b8f1a7e32"}],"trove/tests/unittests/guestagent/test_agent_heartbeats_models.py":[{"author":{"_account_id":6156,"name":"Justin Hopper","email":"justin.hopper@hp.com","username":"justin-hopper"},"change_message_id":"8c26ca8f661c40cc4d2c0cd0176ed3ffd17b658a","unresolved":false,"context_lines":[{"line_number":109,"context_line":"        # get all guests by version"},{"line_number":110,"context_line":"        heartbeats \u003d AgentHeartBeat.find_all_by_version(version)"},{"line_number":111,"context_line":"        self.assertIsNotNone(heartbeats)"},{"line_number":112,"context_line":"        self.assertTrue(heartbeats.count() \u003e\u003d 5)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAWH%2F%2FCZs%3D","line":112,"updated":"2014-03-20 18:38:31.000000000","message":"shouldn\u0027t this be assertEquals(heartbeats.count(), 5)","commit_id":"0a5f8c71bb0b8742471493fc6f27f3e52ebd6da5"},{"author":{"_account_id":6162,"name":"Dan Nguyen","email":"dan.nguyens.mail@gmail.com","username":"daniel-a-nguyen"},"change_message_id":"83b2680c95e89205719b6ca0d5c75134f381264d","unresolved":false,"context_lines":[{"line_number":109,"context_line":"        # get all guests by version"},{"line_number":110,"context_line":"        heartbeats \u003d AgentHeartBeat.find_all_by_version(version)"},{"line_number":111,"context_line":"        self.assertIsNotNone(heartbeats)"},{"line_number":112,"context_line":"        self.assertTrue(heartbeats.count() \u003e\u003d 5)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAWH%2F%2FBlY%3D","line":112,"in_reply_to":"AAAAWH%2F%2FCZs%3D","updated":"2014-03-20 20:44:08.000000000","message":"will fix this up to use a better unique ver","commit_id":"0a5f8c71bb0b8742471493fc6f27f3e52ebd6da5"},{"author":{"_account_id":8415,"name":"Denis M.","email":"lildee1991@gmail.com","username":"dmakogon"},"change_message_id":"d733e4e4ea7feec81118c22e7529ff50f128043a","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright 2014 Hewlett-Packard Development Company, L.P."},{"line_number":2,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\");"},{"line_number":3,"context_line":"# you may not use this file except in compliance with the License."},{"line_number":4,"context_line":"# You may obtain a copy of the License at"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAWH%2F9TUk%3D","line":1,"updated":"2014-04-07 09:07:31.000000000","message":"please use the same headers","commit_id":"ff96e3091d6f80030118dfe8c061578c03ed61c4"},{"author":{"_account_id":6162,"name":"Dan Nguyen","email":"dan.nguyens.mail@gmail.com","username":"daniel-a-nguyen"},"change_message_id":"0bd67fd403ce878cb9161697d3e491aaf83a8e4d","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright 2014 Hewlett-Packard Development Company, L.P."},{"line_number":2,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\");"},{"line_number":3,"context_line":"# you may not use this file except in compliance with the License."},{"line_number":4,"context_line":"# You may obtain a copy of the License at"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAW3%2F%2Fwx4%3D","line":1,"in_reply_to":"AAAAWH%2F9TUk%3D","updated":"2014-04-23 17:52:27.000000000","message":"Done","commit_id":"ff96e3091d6f80030118dfe8c061578c03ed61c4"},{"author":{"_account_id":4240,"name":"Craig Vyvial","email":"cp16net@gmail.com","username":"cp16net"},"change_message_id":"33180adcd870a0edb9737bc9559ee60dc827693d","unresolved":false,"context_lines":[{"line_number":91,"context_line":"            self.assertEqual(heartbeat_found.updated_at,"},{"line_number":92,"context_line":"                             heartbeat.updated_at)"},{"line_number":93,"context_line":"            self.assertEqual(heartbeat_found.guest_agent_version,"},{"line_number":94,"context_line":"                             heartbeat.guest_agent_version)"},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"    def test_find_all_by_version(self):"},{"line_number":97,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":31,"id":"9ad9bd40_46a81620","line":94,"updated":"2014-05-07 06:12:43.000000000","message":"this is testing find_all which should be \u003e1. can you create a second heartbeat and check that the len(heartbeats_found) \u003d\u003d 2\n\nThis can be at the end of this method","commit_id":"2ec69f5e439d94fe792b5925931832b77ddcce5d"},{"author":{"_account_id":6162,"name":"Dan Nguyen","email":"dan.nguyens.mail@gmail.com","username":"daniel-a-nguyen"},"change_message_id":"bee0b634861968f1928bc99ef45b4119b72ec813","unresolved":false,"context_lines":[{"line_number":91,"context_line":"            self.assertEqual(heartbeat_found.updated_at,"},{"line_number":92,"context_line":"                             heartbeat.updated_at)"},{"line_number":93,"context_line":"            self.assertEqual(heartbeat_found.guest_agent_version,"},{"line_number":94,"context_line":"                             heartbeat.guest_agent_version)"},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"    def test_find_all_by_version(self):"},{"line_number":97,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":31,"id":"7adec928_75ee3c8d","line":94,"in_reply_to":"9ad9bd40_46a81620","updated":"2014-05-08 00:18:35.000000000","message":"yep, I\u0027ll try to get that in soon.","commit_id":"2ec69f5e439d94fe792b5925931832b77ddcce5d"},{"author":{"_account_id":8214,"name":"Auston McReynolds","email":"amcreynolds@ebaysf.com","username":"amcreynolds"},"change_message_id":"f2f57a85fbeabc45aea119711d5d76d99531f09a","unresolved":false,"context_lines":[{"line_number":16,"context_line":"from trove.guestagent.models import AgentHeartBeat"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"class AgentHeartBeatTest(testtools.TestCase):"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"    def setUp(self):"},{"line_number":22,"context_line":"        super(AgentHeartBeatTest, self).setUp()"}],"source_content_type":"text/x-python","patch_set":42,"id":"1ae5cdf2_f2cbe01b","line":19,"updated":"2014-06-03 06:11:10.000000000","message":"after the models.py fixes, i\u0027d like to see some negative test-cases added here.\n\n    ex: AgentHeartBeat.find_all_by_version(...) with a non-existent version.\n    ex: AgentHeartBeat.find_by_instance_id(...) with a non-existent instance-id.","commit_id":"21bd3f20d45c863557f738dedcd4928b8f1a7e32"},{"author":{"_account_id":8214,"name":"Auston McReynolds","email":"amcreynolds@ebaysf.com","username":"amcreynolds"},"change_message_id":"ec4249901f5f94b19a52f05315eeafbcc483782c","unresolved":false,"context_lines":[{"line_number":156,"context_line":"        Test to retrieve all guest agents with a non-existing version"},{"line_number":157,"context_line":"        \"\"\""},{"line_number":158,"context_line":"        version \u003d str(uuid.uuid4())"},{"line_number":159,"context_line":"        heartbeats \u003d AgentHeartBeat.find_all_by_version(version)"},{"line_number":160,"context_line":"        self.assertIsNotNone(heartbeats)"},{"line_number":161,"context_line":"        self.assertEqual(0, heartbeats.count())"},{"line_number":162,"context_line":""}],"source_content_type":"text/x-python","patch_set":43,"id":"1ae5cdf2_00c45af3","line":159,"updated":"2014-06-03 22:46:20.000000000","message":"this should look for ModelNotFoundException.","commit_id":"599f0a990d77ddb1b7ae13bafdcb64160502c1e3"}]}
