)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"ce00638987035678b7bad07c8d529882e8ac8f13","unresolved":false,"context_lines":[{"line_number":10,"context_line":"has been transformed to the versioned notification framework."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Change-Id: I48f28a56f9232faf52f458588500a9d77eb6b679"},{"line_number":13,"context_line":"Implements: bp versioned-notification-transformation-pike"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"9f436f4f_39ff8568","line":13,"updated":"2017-08-21 12:29:34.000000000","message":"Please change this to the new bp versioned-notification-transformation-queens.","commit_id":"11eaf06877fcf83ed20f4e4622bdab62d77a89dc"}],"doc/notification_samples/keypair-delete-end.json":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"6da9ad82f108d6f2e70b2bec4d7fff4feaace927","unresolved":false,"context_lines":[{"line_number":7,"context_line":"        \"nova_object.data\": {"},{"line_number":8,"context_line":"            \"user_id\": \"fake\","},{"line_number":9,"context_line":"            \"name\": \"my-key\","},{"line_number":10,"context_line":"            \"fingerprint\": null,"},{"line_number":11,"context_line":"            \"public_key\": null,"},{"line_number":12,"context_line":"            \"type\": \"ssh\""},{"line_number":13,"context_line":"        }"}],"source_content_type":"application/json","patch_set":4,"id":"ff0f0b1f_939d6f5b","line":10,"updated":"2017-05-18 12:31:17.000000000","message":"you will override the value anyhow from the functional test so you can add the same value here as in the delete-start not to suggest that in the delete we not fill the fingerprint","commit_id":"81e632234a207991850370dc32c84aa6ec0d8dbf"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"6da9ad82f108d6f2e70b2bec4d7fff4feaace927","unresolved":false,"context_lines":[{"line_number":8,"context_line":"            \"user_id\": \"fake\","},{"line_number":9,"context_line":"            \"name\": \"my-key\","},{"line_number":10,"context_line":"            \"fingerprint\": null,"},{"line_number":11,"context_line":"            \"public_key\": null,"},{"line_number":12,"context_line":"            \"type\": \"ssh\""},{"line_number":13,"context_line":"        }"},{"line_number":14,"context_line":"    },"}],"source_content_type":"application/json","patch_set":4,"id":"ff0f0b1f_73a2db9c","line":11,"updated":"2017-05-18 12:31:17.000000000","message":"ditto","commit_id":"81e632234a207991850370dc32c84aa6ec0d8dbf"}],"nova/compute/api.py":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"44e121d2d585a7336539bc42bfadb0b3cb7b7ea3","unresolved":false,"context_lines":[{"line_number":4916,"context_line":"        objects.KeyPair.destroy_by_name(context, user_id, key_name)"},{"line_number":4917,"context_line":"        compute_utils.notify_about_keypair_action("},{"line_number":4918,"context_line":"            context\u003dcontext,"},{"line_number":4919,"context_line":"            keypair\u003dself.get_key_pair(context, user_id, key_name),"},{"line_number":4920,"context_line":"            action\u003dfields_obj.NotificationAction.DELETE,"},{"line_number":4921,"context_line":"            phase\u003dfields_obj.NotificationPhase.END)"},{"line_number":4922,"context_line":"        self._notify(context, \u0027delete.end\u0027, key_name)"}],"source_content_type":"text/x-python","patch_set":1,"id":"1f013ff3_16e25202","line":4919,"range":{"start_line":4919,"start_character":20,"end_line":4919,"end_character":65},"updated":"2017-05-16 13:17:17.000000000","message":"here you try to get an already deleted keypair from the db. I  think it will lead to KeypairNotFound exception. I suggest to  use the keypair object you loaded at L4913 here as well to avoid that.","commit_id":"adc0e29c500f4cfe3aad4cf6fd01df6c4da2c36b"}],"nova/tests/functional/notification_sample_tests/test_keypair.py":[{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"1ec7ee13801abf0d94ec312c9c9da88bca1240cc","unresolved":false,"context_lines":[{"line_number":17,"context_line":"class TestKeypairNotificationSample("},{"line_number":18,"context_line":"        notification_sample_base.NotificationSampleTestBase):"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"    def test_keypair_create_delete(self):"},{"line_number":21,"context_line":"        keypair_req \u003d {"},{"line_number":22,"context_line":"            \"keypair\": {"},{"line_number":23,"context_line":"                \"name\": \"my-key\","}],"source_content_type":"text/x-python","patch_set":9,"id":"7f287b81_66aa1686","line":20,"range":{"start_line":20,"start_character":0,"end_line":20,"end_character":41},"updated":"2017-09-04 13:32:10.000000000","message":"Can you split this into two tests? You can move the common parts into a private function (_create_keypair), if necessary","commit_id":"0624412cbca51772bc1a8bbfccbf8113d5e02e49"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"8648e8aa7c5469c31f95fb50fd0ee1bae1b33ede","unresolved":false,"context_lines":[{"line_number":17,"context_line":"class TestKeypairNotificationSample("},{"line_number":18,"context_line":"        notification_sample_base.NotificationSampleTestBase):"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"    def test_keypair_create_delete(self):"},{"line_number":21,"context_line":"        keypair_req \u003d {"},{"line_number":22,"context_line":"            \"keypair\": {"},{"line_number":23,"context_line":"                \"name\": \"my-key\","}],"source_content_type":"text/x-python","patch_set":9,"id":"7f287b81_73de0112","line":20,"range":{"start_line":20,"start_character":0,"end_line":20,"end_character":41},"in_reply_to":"7f287b81_66aa1686","updated":"2017-09-07 09:53:20.000000000","message":"We have plenty of examples where create and delete tested in the same test case[1]. The reason for it is that the delete test case would anyhow exercise the create code path.  In [1] it would be even expensive to do the extra create for the separate delete test case. As keypairs are cheap to create this second reason doesn\u0027t apply here. Bottom line: I don\u0027t have hard opinion about splitting this test case.\n\n[1] https://github.com/openstack/nova/blob/7506ffed5210fc6c67bf89d3b94a0230b3ab5592/nova/tests/functional/notification_sample_tests/test_instance.py#L160","commit_id":"0624412cbca51772bc1a8bbfccbf8113d5e02e49"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"baaa99f0b2c65f9349854b394dd880ddaf993438","unresolved":false,"context_lines":[{"line_number":17,"context_line":"class TestKeypairNotificationSample("},{"line_number":18,"context_line":"        notification_sample_base.NotificationSampleTestBase):"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"    def test_keypair_create_delete(self):"},{"line_number":21,"context_line":"        keypair_req \u003d {"},{"line_number":22,"context_line":"            \"keypair\": {"},{"line_number":23,"context_line":"                \"name\": \"my-key\","}],"source_content_type":"text/x-python","patch_set":9,"id":"7f287b81_f78e4ecf","line":20,"range":{"start_line":20,"start_character":0,"end_line":20,"end_character":41},"in_reply_to":"7f287b81_73de0112","updated":"2017-09-07 18:34:13.000000000","message":"Seems fine to do them in the same test.","commit_id":"0624412cbca51772bc1a8bbfccbf8113d5e02e49"}],"nova/tests/unit/api/openstack/compute/test_keypairs.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"baaa99f0b2c65f9349854b394dd880ddaf993438","unresolved":false,"context_lines":[{"line_number":276,"context_line":"                      ex.explanation)"},{"line_number":277,"context_line":""},{"line_number":278,"context_line":"    def test_keypair_delete(self):"},{"line_number":279,"context_line":"        self.stub_out(\"nova.db.key_pair_get\","},{"line_number":280,"context_line":"                      db_key_pair_get)"},{"line_number":281,"context_line":"        self.controller.delete(self.req, \u0027FAKE\u0027)"},{"line_number":282,"context_line":""},{"line_number":283,"context_line":"    def test_keypair_get_keypair_not_found(self):"}],"source_content_type":"text/x-python","patch_set":9,"id":"7f287b81_d7523235","line":280,"range":{"start_line":279,"start_character":8,"end_line":280,"end_character":38},"updated":"2017-09-07 18:34:13.000000000","message":"This is going to be problematic when we remove the transition code to move keypairs from the cell db to the api db, because this is mocking out the cell db api to return a dict which gets converted into a KeyPair object.\n\nIt would be better to just mock objects.KeyPair.get_by_name.","commit_id":"0624412cbca51772bc1a8bbfccbf8113d5e02e49"}],"nova/tests/unit/compute/test_keypairs.py":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"44e121d2d585a7336539bc42bfadb0b3cb7b7ea3","unresolved":false,"context_lines":[{"line_number":248,"context_line":"class DeleteKeypairTestCase(KeypairAPITestCase):"},{"line_number":249,"context_line":"    @mock.patch(\u0027nova.compute.utils.notify_about_keypair_action\u0027)"},{"line_number":250,"context_line":"    def test_success(self, mock_notify):"},{"line_number":251,"context_line":"        self.keypair_api.get_key_pair(self.ctxt, self.ctxt.user_id,"},{"line_number":252,"context_line":"                                      self.existing_key_name)"},{"line_number":253,"context_line":"        self.keypair_api.delete_key_pair(self.ctxt, self.ctxt.user_id,"},{"line_number":254,"context_line":"                self.existing_key_name)"},{"line_number":255,"context_line":"        self.assertRaises(exception.KeypairNotFound,"}],"source_content_type":"text/x-python","patch_set":1,"id":"1f013ff3_b6a15eac","line":252,"range":{"start_line":251,"start_character":8,"end_line":252,"end_character":61},"updated":"2017-05-16 13:17:17.000000000","message":"Seem like the result of this is a keypair object that is now unused but most probably you wanted to use it in the mock asserts below.","commit_id":"adc0e29c500f4cfe3aad4cf6fd01df6c4da2c36b"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"44e121d2d585a7336539bc42bfadb0b3cb7b7ea3","unresolved":false,"context_lines":[{"line_number":258,"context_line":""},{"line_number":259,"context_line":"        mock_notify.assert_has_calls(["},{"line_number":260,"context_line":"            mock.call(context\u003dself.ctxt,"},{"line_number":261,"context_line":"                      keypair\u003dself.keypair_api.get_key_pair("},{"line_number":262,"context_line":"                          self.ctxt, self.ctxt.user_id, self.existing_key_name),"},{"line_number":263,"context_line":"                      action\u003d\u0027delete\u0027, phase\u003d\u0027start\u0027),"},{"line_number":264,"context_line":"            mock.call(context\u003dself.ctxt,"}],"source_content_type":"text/x-python","patch_set":1,"id":"1f013ff3_9692e24a","line":261,"range":{"start_line":261,"start_character":30,"end_line":261,"end_character":60},"updated":"2017-05-16 13:17:17.000000000","message":"I think this calls would cause KeypairNotFound exception as the keypair is already deleted at L253. So I suggest to use the keypair you loaded at L251 for these asserts","commit_id":"adc0e29c500f4cfe3aad4cf6fd01df6c4da2c36b"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"6da9ad82f108d6f2e70b2bec4d7fff4feaace927","unresolved":false,"context_lines":[{"line_number":256,"context_line":""},{"line_number":257,"context_line":"        mock_notify.assert_has_calls(["},{"line_number":258,"context_line":"            mock.call(context\u003dself.ctxt,"},{"line_number":259,"context_line":"                      keypair\u003dmock.ANY,"},{"line_number":260,"context_line":"                      action\u003d\u0027delete\u0027, phase\u003d\u0027start\u0027),"},{"line_number":261,"context_line":"            mock.call(context\u003dself.ctxt,"},{"line_number":262,"context_line":"                      keypair\u003dmock.ANY,"}],"source_content_type":"text/x-python","patch_set":4,"id":"ff0f0b1f_93ba0fdc","line":259,"updated":"2017-05-18 12:31:17.000000000","message":"You can assert at least that the name in keypair is the same as self.existing_key_name value with nova.tests.unit.utils.CustomMockCallMatcher","commit_id":"81e632234a207991850370dc32c84aa6ec0d8dbf"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"1ec7ee13801abf0d94ec312c9c9da88bca1240cc","unresolved":false,"context_lines":[{"line_number":252,"context_line":"                self.keypair_api.get_key_pair, self.ctxt, self.ctxt.user_id,"},{"line_number":253,"context_line":"                self.existing_key_name)"},{"line_number":254,"context_line":""},{"line_number":255,"context_line":"        match_by_name \u003d test_utils.CustomMockCallMatcher("},{"line_number":256,"context_line":"            lambda keypair: keypair[\u0027name\u0027] \u003d\u003d self.existing_key_name)"},{"line_number":257,"context_line":""},{"line_number":258,"context_line":"        mock_notify.assert_has_calls(["}],"source_content_type":"text/x-python","patch_set":9,"id":"7f287b81_2603ee44","line":255,"range":{"start_line":255,"start_character":35,"end_line":255,"end_character":56},"updated":"2017-09-04 13:32:10.000000000","message":"I didn\u0027t even know this was a thing. Niice","commit_id":"0624412cbca51772bc1a8bbfccbf8113d5e02e49"}]}
