)]}'
{"nova/objects/instance.py":[{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"fd87f8a32728382625a18ea91d8d90d7446b0332","unresolved":false,"context_lines":[{"line_number":1277,"context_line":"        keypairs \u003d objects.KeyPairList(objects\u003d[])"},{"line_number":1278,"context_line":"        if key_name:"},{"line_number":1279,"context_line":"            key \u003d objects.KeyPair.get_by_name(ctxt, db_extra.instance.user_id,"},{"line_number":1280,"context_line":"                                              key_name)"},{"line_number":1281,"context_line":"            try:"},{"line_number":1282,"context_line":"                keypairs.objects.append(key)"},{"line_number":1283,"context_line":"            except exception.KeypairNotFound:"}],"source_content_type":"text/x-python","patch_set":4,"id":"dab17558_ae587233","line":1280,"updated":"2016-05-09 16:04:06.000000000","message":"The above two lines need to be in the try/except block below, otherwise KeypairNotFound won\u0027t be caught.","commit_id":"d6f159584ba7ce767b22caffffb56af67e6684bc"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"61be0e7b72160a1e39c68b08d811e55e0548c7f0","unresolved":false,"context_lines":[{"line_number":1277,"context_line":"        keypairs \u003d objects.KeyPairList(objects\u003d[])"},{"line_number":1278,"context_line":"        if key_name:"},{"line_number":1279,"context_line":"            key \u003d objects.KeyPair.get_by_name(ctxt, db_extra.instance.user_id,"},{"line_number":1280,"context_line":"                                              key_name)"},{"line_number":1281,"context_line":"            try:"},{"line_number":1282,"context_line":"                keypairs.objects.append(key)"},{"line_number":1283,"context_line":"            except exception.KeypairNotFound:"}],"source_content_type":"text/x-python","patch_set":4,"id":"dab17558_e4261bcd","line":1280,"in_reply_to":"dab17558_ae587233","updated":"2016-05-09 17:10:30.000000000","message":"Oops, yep, just refactored it wrongly at some point. Thanks.","commit_id":"d6f159584ba7ce767b22caffffb56af67e6684bc"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"7f774555d5a9271eefadafa6353b8053b2ddaad1","unresolved":false,"context_lines":[{"line_number":1286,"context_line":"                    _LW(\u0027Instance %(uuid)s keypair %(keyname)s not found\u0027),"},{"line_number":1287,"context_line":"                    {\u0027uuid\u0027: db_extra.instance_uuid, \u0027keyname\u0027: key_name})"},{"line_number":1288,"context_line":"                pass"},{"line_number":1289,"context_line":"        db_extra.keypairs \u003d jsonutils.dumps(keypairs.obj_to_primitive())"},{"line_number":1290,"context_line":"        db_extra.save(ctxt.session)"},{"line_number":1291,"context_line":"        count_hit +\u003d 1"},{"line_number":1292,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"dab17558_7d38ccef","line":1289,"updated":"2016-05-10 14:26:28.000000000","message":"Let me check my understanding here. The earlier patches leave this keypairs column as null if an instance is created with no key provided, but this migration populates the column with an empty KeyPairList if the instance did not have a key provided?\n\nI think there should be consistency here, either leaving them all null or populating them all. For the db migration populating it is the obvious choice because it is an easy marker for batching the migrations. But at the same time instances could be continually being added with no key_name, so theoretically this might never finish.","commit_id":"ae550756156f9b9ae1ef94df80ebbe1d38d811ca"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"68913d7390f89488ea8263470d111cff16a3d75d","unresolved":false,"context_lines":[{"line_number":1289,"context_line":"                LOG.warning("},{"line_number":1290,"context_line":"                    _LW(\u0027Instance %(uuid)s keypair %(keyname)s not found\u0027),"},{"line_number":1291,"context_line":"                    {\u0027uuid\u0027: db_extra.instance_uuid, \u0027keyname\u0027: key_name})"},{"line_number":1292,"context_line":"                pass"},{"line_number":1293,"context_line":"        db_extra.keypairs \u003d jsonutils.dumps(keypairs.obj_to_primitive())"},{"line_number":1294,"context_line":"        db_extra.save(ctxt.session)"},{"line_number":1295,"context_line":"        count_hit +\u003d 1"}],"source_content_type":"text/x-python","patch_set":10,"id":"dab17558_61757dc9","line":1292,"range":{"start_line":1292,"start_character":16,"end_line":1292,"end_character":20},"updated":"2016-05-11 18:03:25.000000000","message":"You don\u0027t need this.","commit_id":"0016d432042d72430015b6f0eb0ddc3f830f3066"}],"nova/tests/unit/objects/test_instance.py":[{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"fd87f8a32728382625a18ea91d8d90d7446b0332","unresolved":false,"context_lines":[{"line_number":1759,"context_line":"        self.assertEqual(1, done)"},{"line_number":1760,"context_line":"        db_extra \u003d db.instance_extra_get_by_instance_uuid("},{"line_number":1761,"context_line":"            ctxt, inst1.uuid, [\u0027keypairs\u0027])"},{"line_number":1762,"context_line":"        self.assertIsNotNone(db_extra.keypairs)"}],"source_content_type":"text/x-python","patch_set":4,"id":"dab17558_8e5bee2d","line":1762,"updated":"2016-05-09 16:04:06.000000000","message":"You may want to add to the above test a scenario where a keypair does not exist in the main database that would trigger the warning/except above that doesn\u0027t include the get_by_name() call. Not sure how you would do this test, though, since it would essentially be emulating a race condition where multiple writers were migrating keypair records at the same time...","commit_id":"d6f159584ba7ce767b22caffffb56af67e6684bc"}]}
