)]}'
{"nova/compute/api.py":[{"author":{"_account_id":6062,"name":"jichenjc","email":"jichenjc@cn.ibm.com","username":"jichenjc"},"change_message_id":"f957a3c664c8001df27bab559f462a09a2966c60","unresolved":false,"context_lines":[{"line_number":261,"context_line":"        if CONF.ephemeral_storage_encryption.enabled:"},{"line_number":262,"context_line":"            self.key_manager \u003d key_manager.API()"},{"line_number":263,"context_line":"        # Help us to record host in EventReporter"},{"line_number":264,"context_line":"        self.host \u003d CONF.host"},{"line_number":265,"context_line":"        super(API, self).__init__(**kwargs)"},{"line_number":266,"context_line":""},{"line_number":267,"context_line":"    @property"}],"source_content_type":"text/x-python","patch_set":2,"id":"bf659307_54230406","line":264,"range":{"start_line":264,"start_character":8,"end_line":264,"end_character":29},"updated":"2018-03-27 05:41:15.000000000","message":"this code should running on API node, I don\u0027t know why we need record this host of nova APi running on and use it ?\n\nmy thought is nova-api is stateless and no reason to use it at nova-compute which runs workload is another story...","commit_id":"484268133d388644b892e3e708531324ef9aadd4"},{"author":{"_account_id":20722,"name":"Yikun Jiang","email":"yikunkero@gmail.com","username":"yikunkero"},"change_message_id":"79acc6075a01b78d5338e16f780f17cbb2a1d184","unresolved":false,"context_lines":[{"line_number":261,"context_line":"        if CONF.ephemeral_storage_encryption.enabled:"},{"line_number":262,"context_line":"            self.key_manager \u003d key_manager.API()"},{"line_number":263,"context_line":"        # Help us to record host in EventReporter"},{"line_number":264,"context_line":"        self.host \u003d CONF.host"},{"line_number":265,"context_line":"        super(API, self).__init__(**kwargs)"},{"line_number":266,"context_line":""},{"line_number":267,"context_line":"    @property"}],"source_content_type":"text/x-python","patch_set":2,"id":"bf659307_cf1781a3","line":264,"range":{"start_line":264,"start_character":8,"end_line":264,"end_character":29},"in_reply_to":"bf659307_54230406","updated":"2018-03-27 06:49:24.000000000","message":"@jichen See link as below:\nhttps://review.openstack.org/#/c/543277/2/specs/rocky/approved/add-host-to-instance-action-events.rst@43\n\nWe already had some discussion on it, this host info helps admins to find the host of events occuring.\n\nAnd in some cloud deployment, such as public cloud, we maybe have more than 10 api services work for sharing work load.\n\nIf a error events occuring, but unfortunately, we can\u0027t get the detail error event from api response; or the usecase like we just want to investigate why a api response is so slow, maybe reason is related to some specific host. In short, there is such a possibility we need find the host of API/Conductor.\n\nSo, we also need record the event host of API/Conductor otherwise we have to dig the log using req_id on every host manually(TBH, this is a true user story what I have done again and again).","commit_id":"484268133d388644b892e3e708531324ef9aadd4"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"b568f287f084cd32d11b7b2a23cd3939c4f7c7ca","unresolved":false,"context_lines":[{"line_number":261,"context_line":"        if CONF.ephemeral_storage_encryption.enabled:"},{"line_number":262,"context_line":"            self.key_manager \u003d key_manager.API()"},{"line_number":263,"context_line":"        # Help us to record host in EventReporter"},{"line_number":264,"context_line":"        self.host \u003d CONF.host"},{"line_number":265,"context_line":"        super(API, self).__init__(**kwargs)"},{"line_number":266,"context_line":""},{"line_number":267,"context_line":"    @property"}],"source_content_type":"text/x-python","patch_set":2,"id":"bf659307_af4c8d9e","line":264,"range":{"start_line":264,"start_character":8,"end_line":264,"end_character":29},"in_reply_to":"bf659307_54230406","updated":"2018-03-27 06:42:27.000000000","message":"I think he is trying to record host information to the action event records, and we also record them here like in https://review.openstack.org/#/c/556513/2/nova/compute/api.py@2912 so should also be able to report the host info.","commit_id":"484268133d388644b892e3e708531324ef9aadd4"},{"author":{"_account_id":20722,"name":"Yikun Jiang","email":"yikunkero@gmail.com","username":"yikunkero"},"change_message_id":"ab1f2eb4616f4960a34dc1d7bd091784dc1c3553","unresolved":false,"context_lines":[{"line_number":261,"context_line":"        if CONF.ephemeral_storage_encryption.enabled:"},{"line_number":262,"context_line":"            self.key_manager \u003d key_manager.API()"},{"line_number":263,"context_line":"        # Help us to record host in EventReporter"},{"line_number":264,"context_line":"        self.host \u003d CONF.host"},{"line_number":265,"context_line":"        super(API, self).__init__(**kwargs)"},{"line_number":266,"context_line":""},{"line_number":267,"context_line":"    @property"}],"source_content_type":"text/x-python","patch_set":2,"id":"bf659307_91a83c8c","line":264,"range":{"start_line":264,"start_character":8,"end_line":264,"end_character":29},"in_reply_to":"bf659307_761a50c6","updated":"2018-04-13 12:13:57.000000000","message":"Yeah, @wrap_instance_event(prefix\u003d\u0027api\u0027)","commit_id":"484268133d388644b892e3e708531324ef9aadd4"},{"author":{"_account_id":20722,"name":"Yikun Jiang","email":"yikunkero@gmail.com","username":"yikunkero"},"change_message_id":"93f8c45f6053493a84a21e1526635df8e29c2184","unresolved":false,"context_lines":[{"line_number":261,"context_line":"        if CONF.ephemeral_storage_encryption.enabled:"},{"line_number":262,"context_line":"            self.key_manager \u003d key_manager.API()"},{"line_number":263,"context_line":"        # Help us to record host in EventReporter"},{"line_number":264,"context_line":"        self.host \u003d CONF.host"},{"line_number":265,"context_line":"        super(API, self).__init__(**kwargs)"},{"line_number":266,"context_line":""},{"line_number":267,"context_line":"    @property"}],"source_content_type":"text/x-python","patch_set":2,"id":"bf659307_ba84c95f","line":264,"range":{"start_line":264,"start_character":8,"end_line":264,"end_character":29},"in_reply_to":"bf659307_af4c8d9e","updated":"2018-03-27 06:52:46.000000000","message":"As @Kevin mentioned, current we have 5 action events record in API:\n* snapshot_instance\n* lock/unlock\n* attach_volume/detach_volume","commit_id":"484268133d388644b892e3e708531324ef9aadd4"},{"author":{"_account_id":6062,"name":"jichenjc","email":"jichenjc@cn.ibm.com","username":"jichenjc"},"change_message_id":"0536768f3fbe0e77ea5497fcf3085b457ae47a90","unresolved":false,"context_lines":[{"line_number":261,"context_line":"        if CONF.ephemeral_storage_encryption.enabled:"},{"line_number":262,"context_line":"            self.key_manager \u003d key_manager.API()"},{"line_number":263,"context_line":"        # Help us to record host in EventReporter"},{"line_number":264,"context_line":"        self.host \u003d CONF.host"},{"line_number":265,"context_line":"        super(API, self).__init__(**kwargs)"},{"line_number":266,"context_line":""},{"line_number":267,"context_line":"    @property"}],"source_content_type":"text/x-python","patch_set":2,"id":"bf659307_babe0963","line":264,"range":{"start_line":264,"start_character":8,"end_line":264,"end_character":29},"in_reply_to":"bf659307_ba84c95f","updated":"2018-03-27 07:20:06.000000000","message":"ok, now I get the point ,thanks for clarify","commit_id":"484268133d388644b892e3e708531324ef9aadd4"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"15286b0cbc9819c3e05a2c4d2d72fdf5b751285b","unresolved":false,"context_lines":[{"line_number":261,"context_line":"        if CONF.ephemeral_storage_encryption.enabled:"},{"line_number":262,"context_line":"            self.key_manager \u003d key_manager.API()"},{"line_number":263,"context_line":"        # Help us to record host in EventReporter"},{"line_number":264,"context_line":"        self.host \u003d CONF.host"},{"line_number":265,"context_line":"        super(API, self).__init__(**kwargs)"},{"line_number":266,"context_line":""},{"line_number":267,"context_line":"    @property"}],"source_content_type":"text/x-python","patch_set":2,"id":"bf659307_761a50c6","line":264,"range":{"start_line":264,"start_character":8,"end_line":264,"end_character":29},"in_reply_to":"bf659307_babe0963","updated":"2018-04-12 20:34:30.000000000","message":"I don\u0027t see anything using EventReporter directly in the API code like in conductor.\n\nSo the conductor changes here are pretty obvious:\n\nhttps://review.openstack.org/#/c/556746/3/nova/conductor/manager.py\n\nBut EventReporter is used from the API service indirectly via wrap_instance_event as Kevin Zheng pointed out, which is also changed in the next patch in the series:\n\nhttps://review.openstack.org/#/c/556746/3/nova/compute/utils.py@986\n\nIt took me a second to link those up but this looks OK.","commit_id":"484268133d388644b892e3e708531324ef9aadd4"}],"nova/tests/unit/compute/test_compute_api.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"15286b0cbc9819c3e05a2c4d2d72fdf5b751285b","unresolved":false,"context_lines":[{"line_number":6013,"context_line":"        self._test_delete_volume_backed_instance(vm_states.SHELVED_OFFLOADED)"},{"line_number":6014,"context_line":""},{"line_number":6015,"context_line":"    def test_compute_api_host(self):"},{"line_number":6016,"context_line":"        self.assertTrue(hasattr(self.compute_api, \u0027host\u0027))"},{"line_number":6017,"context_line":"        self.assertEqual(self.compute_api.host, CONF.host)"},{"line_number":6018,"context_line":""},{"line_number":6019,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"bf659307_f6d180cd","line":6016,"updated":"2018-04-12 20:34:30.000000000","message":"Could we use assertIn here?","commit_id":"484268133d388644b892e3e708531324ef9aadd4"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"bc63f883e38f9ca10746d76301df845c89ffbbcd","unresolved":false,"context_lines":[{"line_number":6013,"context_line":"        self._test_delete_volume_backed_instance(vm_states.SHELVED_OFFLOADED)"},{"line_number":6014,"context_line":""},{"line_number":6015,"context_line":"    def test_compute_api_host(self):"},{"line_number":6016,"context_line":"        self.assertTrue(hasattr(self.compute_api, \u0027host\u0027))"},{"line_number":6017,"context_line":"        self.assertEqual(self.compute_api.host, CONF.host)"},{"line_number":6018,"context_line":""},{"line_number":6019,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"bf659307_2936a804","line":6016,"in_reply_to":"bf659307_11f18c95","updated":"2018-04-13 14:10:10.000000000","message":"Yeah I thought maybe it would also do a hasattr check but I guess not. I also looked for something like assertHasAttr in testtools but couldn\u0027t find anything, so this is OK.","commit_id":"484268133d388644b892e3e708531324ef9aadd4"},{"author":{"_account_id":20722,"name":"Yikun Jiang","email":"yikunkero@gmail.com","username":"yikunkero"},"change_message_id":"ab1f2eb4616f4960a34dc1d7bd091784dc1c3553","unresolved":false,"context_lines":[{"line_number":6013,"context_line":"        self._test_delete_volume_backed_instance(vm_states.SHELVED_OFFLOADED)"},{"line_number":6014,"context_line":""},{"line_number":6015,"context_line":"    def test_compute_api_host(self):"},{"line_number":6016,"context_line":"        self.assertTrue(hasattr(self.compute_api, \u0027host\u0027))"},{"line_number":6017,"context_line":"        self.assertEqual(self.compute_api.host, CONF.host)"},{"line_number":6018,"context_line":""},{"line_number":6019,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"bf659307_11f18c95","line":6016,"in_reply_to":"bf659307_f6d180cd","updated":"2018-04-13 12:13:57.000000000","message":"(Pdb) self.assertIn(\u0027host\u0027, self.compute_api)\n*** MismatchError: \u0027host\u0027 not in \u003cnova.compute.api.API object at 0x7f1651a36890\u003e\n(Pdb) hasattr(self.compute_api, \u0027host\u0027)\nTrue\n\nUnfortunately, No. The reason as below:\n\n\u003e\u003e\u003e class A(object):\n...     x\u003d1\n...\n\u003e\u003e\u003e A.x\n1\n\u003e\u003e\u003e bool(\u0027x\u0027 in A)\nTraceback (most recent call last):\n  File \"\u003cstdin\u003e\", line 1, in \u003cmodule\u003e\nTypeError: argument of type \u0027type\u0027 is not iterable","commit_id":"484268133d388644b892e3e708531324ef9aadd4"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"15286b0cbc9819c3e05a2c4d2d72fdf5b751285b","unresolved":false,"context_lines":[{"line_number":6014,"context_line":""},{"line_number":6015,"context_line":"    def test_compute_api_host(self):"},{"line_number":6016,"context_line":"        self.assertTrue(hasattr(self.compute_api, \u0027host\u0027))"},{"line_number":6017,"context_line":"        self.assertEqual(self.compute_api.host, CONF.host)"},{"line_number":6018,"context_line":""},{"line_number":6019,"context_line":""},{"line_number":6020,"context_line":"class Cellsv1DeprecatedTestMixIn(object):"}],"source_content_type":"text/x-python","patch_set":2,"id":"bf659307_f65c207e","line":6017,"range":{"start_line":6017,"start_character":25,"end_line":6017,"end_character":57},"updated":"2018-04-12 20:34:30.000000000","message":"nit: these arguments should be reversed since the parameters are (expected, actual) which will impact the result of the MismatchError if this assertion fails.","commit_id":"484268133d388644b892e3e708531324ef9aadd4"},{"author":{"_account_id":20722,"name":"Yikun Jiang","email":"yikunkero@gmail.com","username":"yikunkero"},"change_message_id":"ab1f2eb4616f4960a34dc1d7bd091784dc1c3553","unresolved":false,"context_lines":[{"line_number":6014,"context_line":""},{"line_number":6015,"context_line":"    def test_compute_api_host(self):"},{"line_number":6016,"context_line":"        self.assertTrue(hasattr(self.compute_api, \u0027host\u0027))"},{"line_number":6017,"context_line":"        self.assertEqual(self.compute_api.host, CONF.host)"},{"line_number":6018,"context_line":""},{"line_number":6019,"context_line":""},{"line_number":6020,"context_line":"class Cellsv1DeprecatedTestMixIn(object):"}],"source_content_type":"text/x-python","patch_set":2,"id":"bf659307_b1b220e4","line":6017,"range":{"start_line":6017,"start_character":25,"end_line":6017,"end_character":57},"in_reply_to":"bf659307_f65c207e","updated":"2018-04-13 12:13:57.000000000","message":"Got it, I will address it in a separate patch.","commit_id":"484268133d388644b892e3e708531324ef9aadd4"}],"nova/tests/unit/conductor/test_conductor.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"15286b0cbc9819c3e05a2c4d2d72fdf5b751285b","unresolved":false,"context_lines":[{"line_number":288,"context_line":""},{"line_number":289,"context_line":"    def test_conductor_host(self):"},{"line_number":290,"context_line":"        self.assertTrue(hasattr(self.conductor_manager, \u0027host\u0027))"},{"line_number":291,"context_line":"        self.assertEqual(self.conductor_manager.host, CONF.host)"},{"line_number":292,"context_line":""},{"line_number":293,"context_line":""},{"line_number":294,"context_line":"class ConductorRPCAPITestCase(_BaseTestCase, test.TestCase):"}],"source_content_type":"text/x-python","patch_set":2,"id":"bf659307_9657e458","line":291,"updated":"2018-04-12 20:34:30.000000000","message":"same","commit_id":"484268133d388644b892e3e708531324ef9aadd4"},{"author":{"_account_id":20722,"name":"Yikun Jiang","email":"yikunkero@gmail.com","username":"yikunkero"},"change_message_id":"ab1f2eb4616f4960a34dc1d7bd091784dc1c3553","unresolved":false,"context_lines":[{"line_number":288,"context_line":""},{"line_number":289,"context_line":"    def test_conductor_host(self):"},{"line_number":290,"context_line":"        self.assertTrue(hasattr(self.conductor_manager, \u0027host\u0027))"},{"line_number":291,"context_line":"        self.assertEqual(self.conductor_manager.host, CONF.host)"},{"line_number":292,"context_line":""},{"line_number":293,"context_line":""},{"line_number":294,"context_line":"class ConductorRPCAPITestCase(_BaseTestCase, test.TestCase):"}],"source_content_type":"text/x-python","patch_set":2,"id":"bf659307_f1f4185d","line":291,"in_reply_to":"bf659307_9657e458","updated":"2018-04-13 12:13:57.000000000","message":"same done :)","commit_id":"484268133d388644b892e3e708531324ef9aadd4"},{"author":{"_account_id":20722,"name":"Yikun Jiang","email":"yikunkero@gmail.com","username":"yikunkero"},"change_message_id":"bba12a6cfda5665f3ffecc029eb19ddedb220376","unresolved":false,"context_lines":[{"line_number":288,"context_line":""},{"line_number":289,"context_line":"    def test_conductor_host(self):"},{"line_number":290,"context_line":"        self.assertTrue(hasattr(self.conductor_manager, \u0027host\u0027))"},{"line_number":291,"context_line":"        self.assertEqual(self.conductor_manager.host, CONF.host)"},{"line_number":292,"context_line":""},{"line_number":293,"context_line":""},{"line_number":294,"context_line":"class ConductorRPCAPITestCase(_BaseTestCase, test.TestCase):"}],"source_content_type":"text/x-python","patch_set":2,"id":"bf659307_71aec82e","line":291,"in_reply_to":"bf659307_f1f4185d","updated":"2018-04-13 12:16:15.000000000","message":"address nits in here: https://review.openstack.org/#/c/561205","commit_id":"484268133d388644b892e3e708531324ef9aadd4"}]}
