)]}'
{"ironic/conductor/manager.py":[{"author":{"_account_id":14891,"name":"Lilia Sampaio","email":"liliars@lsd.ufcg.edu.br","username":"liliars"},"change_message_id":"37b4f5bde52d7aeace4c52d040e7e828d747ed31","unresolved":false,"context_lines":[{"line_number":2437,"context_line":""},{"line_number":2438,"context_line":"    last_error_msg \u003d None"},{"line_number":2439,"context_line":"    if exception_msg:"},{"line_number":2440,"context_line":"        last_error_msg \u003d (_(\"An exception occurred during sync_power_state. \""},{"line_number":2441,"context_line":"                            \"Error: %s\") % exception_msg)"},{"line_number":2442,"context_line":""},{"line_number":2443,"context_line":"    node.power_state \u003d actual_power_state"}],"source_content_type":"text/x-python","patch_set":1,"id":"3a29b11f_398e9cd0","line":2440,"updated":"2015-10-21 17:18:19.000000000","message":"Lacking a reference for the respective node? Tried to see if the reference is coming from somewhere else, like in \u0027exception_msg\u0027, but couldn\u0027t find any.","commit_id":"41e153aa4a0365b5f9a6094e5a6f95dd2848d1df"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"09d2a3fae04181300936df9539b22fd505efdce9","unresolved":false,"context_lines":[{"line_number":2437,"context_line":""},{"line_number":2438,"context_line":"    last_error_msg \u003d None"},{"line_number":2439,"context_line":"    if exception_msg:"},{"line_number":2440,"context_line":"        last_error_msg \u003d (_(\"An exception occurred during sync_power_state. \""},{"line_number":2441,"context_line":"                            \"Error: %s\") % exception_msg)"},{"line_number":2442,"context_line":""},{"line_number":2443,"context_line":"    node.power_state \u003d actual_power_state"}],"source_content_type":"text/x-python","patch_set":1,"id":"3a29b11f_81b2c0e3","line":2440,"in_reply_to":"3a29b11f_398e9cd0","updated":"2015-10-22 08:45:06.000000000","message":"The node UUID? I can add it but it was intentional to leave it out because this message is not going to be in the logs, instead it\u0027s going to be at the node\u0027s last_error attribute so people reading it already knows which node was affected by this problem. \n\nLet me know what you think.","commit_id":"41e153aa4a0365b5f9a6094e5a6f95dd2848d1df"},{"author":{"_account_id":14891,"name":"Lilia Sampaio","email":"liliars@lsd.ufcg.edu.br","username":"liliars"},"change_message_id":"bc5a058c0e62829781ed89a075a0e21f449a1da5","unresolved":false,"context_lines":[{"line_number":2437,"context_line":""},{"line_number":2438,"context_line":"    last_error_msg \u003d None"},{"line_number":2439,"context_line":"    if exception_msg:"},{"line_number":2440,"context_line":"        last_error_msg \u003d (_(\"An exception occurred during sync_power_state. \""},{"line_number":2441,"context_line":"                            \"Error: %s\") % exception_msg)"},{"line_number":2442,"context_line":""},{"line_number":2443,"context_line":"    node.power_state \u003d actual_power_state"}],"source_content_type":"text/x-python","patch_set":1,"id":"3a29b11f_a61f8808","line":2440,"in_reply_to":"3a29b11f_81b2c0e3","updated":"2015-10-23 23:17:59.000000000","message":"Oh then thats fine, thought they would be in the logs too. Makes sense (:","commit_id":"41e153aa4a0365b5f9a6094e5a6f95dd2848d1df"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"c5d469a10030f6bd5868f6e297224116ddf51c81","unresolved":false,"context_lines":[{"line_number":2445,"context_line":"    node.maintenance \u003d True"},{"line_number":2446,"context_line":"    node.maintenance_reason \u003d msg"},{"line_number":2447,"context_line":"    node.save()"},{"line_number":2448,"context_line":"    LOG.error(msg)"},{"line_number":2449,"context_line":""},{"line_number":2450,"context_line":""},{"line_number":2451,"context_line":"def do_sync_power_state(task, count):"}],"source_content_type":"text/x-python","patch_set":1,"id":"3a29b11f_019a306e","line":2448,"updated":"2015-10-22 08:46:12.000000000","message":"seems it\u0027s more helpful to log the actual exception message as well if last_error_msg is not None.","commit_id":"41e153aa4a0365b5f9a6094e5a6f95dd2848d1df"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"bb2b253bbe4f5e7ef734d4b16f17f30ec44a4bb7","unresolved":false,"context_lines":[{"line_number":2445,"context_line":"    node.maintenance \u003d True"},{"line_number":2446,"context_line":"    node.maintenance_reason \u003d msg"},{"line_number":2447,"context_line":"    node.save()"},{"line_number":2448,"context_line":"    LOG.error(msg)"},{"line_number":2449,"context_line":""},{"line_number":2450,"context_line":""},{"line_number":2451,"context_line":"def do_sync_power_state(task, count):"}],"source_content_type":"text/x-python","patch_set":1,"id":"3a29b11f_249e5007","line":2448,"in_reply_to":"3a29b11f_019a306e","updated":"2015-10-22 13:14:33.000000000","message":"Cool, yeah we perhaps can log both messages, I will update the patch","commit_id":"41e153aa4a0365b5f9a6094e5a6f95dd2848d1df"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"5c01bf30caa3d1ee9e3d7c0e8afa7b2a6133524d","unresolved":false,"context_lines":[{"line_number":2437,"context_line":""},{"line_number":2438,"context_line":"    last_error_msg \u003d None"},{"line_number":2439,"context_line":"    if exception_msg:"},{"line_number":2440,"context_line":"        last_error_msg \u003d (_(\u0027An exception occurred during sync_power_state \u0027"},{"line_number":2441,"context_line":"                            \u0027for node %(node)s. Error: \"%(error)s\"\u0027) %"},{"line_number":2442,"context_line":"                          {\u0027node\u0027: node.uuid, \u0027error\u0027: exception_msg})"},{"line_number":2443,"context_line":"        LOG.error(last_error_msg)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a29b11f_727ac689","line":2440,"updated":"2015-10-22 13:37:37.000000000","message":"s/during sync_power_state/while syncing power state/ for human readability","commit_id":"bc91d61ef0f932de6ee00470b49532dfe2e7a55e"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"430f70989c2be1d650fb366c370c170d61f3e66d","unresolved":false,"context_lines":[{"line_number":2437,"context_line":""},{"line_number":2438,"context_line":"    last_error_msg \u003d None"},{"line_number":2439,"context_line":"    if exception_msg:"},{"line_number":2440,"context_line":"        last_error_msg \u003d (_(\u0027An exception occurred during sync_power_state \u0027"},{"line_number":2441,"context_line":"                            \u0027for node %(node)s. Error: \"%(error)s\"\u0027) %"},{"line_number":2442,"context_line":"                          {\u0027node\u0027: node.uuid, \u0027error\u0027: exception_msg})"},{"line_number":2443,"context_line":"        LOG.error(last_error_msg)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a29b11f_12aa7285","line":2440,"in_reply_to":"3a29b11f_727ac689","updated":"2015-10-22 13:42:15.000000000","message":"Done","commit_id":"bc91d61ef0f932de6ee00470b49532dfe2e7a55e"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"5c01bf30caa3d1ee9e3d7c0e8afa7b2a6133524d","unresolved":false,"context_lines":[{"line_number":2438,"context_line":"    last_error_msg \u003d None"},{"line_number":2439,"context_line":"    if exception_msg:"},{"line_number":2440,"context_line":"        last_error_msg \u003d (_(\u0027An exception occurred during sync_power_state \u0027"},{"line_number":2441,"context_line":"                            \u0027for node %(node)s. Error: \"%(error)s\"\u0027) %"},{"line_number":2442,"context_line":"                          {\u0027node\u0027: node.uuid, \u0027error\u0027: exception_msg})"},{"line_number":2443,"context_line":"        LOG.error(last_error_msg)"},{"line_number":2444,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"3a29b11f_f23fb6b1","line":2441,"updated":"2015-10-22 13:37:37.000000000","message":"please keep the \"switching to maintenance mode\" bit","commit_id":"bc91d61ef0f932de6ee00470b49532dfe2e7a55e"},{"author":{"_account_id":6637,"name":"Sam Betts","email":"sam@code-smash.net","username":"sambetts"},"change_message_id":"87739b4e3d6cb095e073994ac4633f2403efa12c","unresolved":false,"context_lines":[{"line_number":2438,"context_line":"    last_error_msg \u003d None"},{"line_number":2439,"context_line":"    if exception_msg:"},{"line_number":2440,"context_line":"        last_error_msg \u003d (_(\u0027An exception occurred during sync_power_state \u0027"},{"line_number":2441,"context_line":"                            \u0027for node %(node)s. Error: \"%(error)s\"\u0027) %"},{"line_number":2442,"context_line":"                          {\u0027node\u0027: node.uuid, \u0027error\u0027: exception_msg})"},{"line_number":2443,"context_line":"        LOG.error(last_error_msg)"},{"line_number":2444,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"3a29b11f_32844e09","line":2441,"in_reply_to":"3a29b11f_f23fb6b1","updated":"2015-10-22 13:44:05.000000000","message":"+1","commit_id":"bc91d61ef0f932de6ee00470b49532dfe2e7a55e"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"430f70989c2be1d650fb366c370c170d61f3e66d","unresolved":false,"context_lines":[{"line_number":2438,"context_line":"    last_error_msg \u003d None"},{"line_number":2439,"context_line":"    if exception_msg:"},{"line_number":2440,"context_line":"        last_error_msg \u003d (_(\u0027An exception occurred during sync_power_state \u0027"},{"line_number":2441,"context_line":"                            \u0027for node %(node)s. Error: \"%(error)s\"\u0027) %"},{"line_number":2442,"context_line":"                          {\u0027node\u0027: node.uuid, \u0027error\u0027: exception_msg})"},{"line_number":2443,"context_line":"        LOG.error(last_error_msg)"},{"line_number":2444,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"3a29b11f_32ad2e9b","line":2441,"in_reply_to":"3a29b11f_f23fb6b1","updated":"2015-10-22 13:42:15.000000000","message":"Done","commit_id":"bc91d61ef0f932de6ee00470b49532dfe2e7a55e"},{"author":{"_account_id":7711,"name":"Yuriy Zveryanskyy","email":"yzveryanskyy@mirantis.com","username":"yuriyz"},"change_message_id":"af287fbcf4036d359392e8f93a9364313dc02841","unresolved":false,"context_lines":[{"line_number":2491,"context_line":"        if count \u003e max_retries:"},{"line_number":2492,"context_line":"            task.upgrade_lock()"},{"line_number":2493,"context_line":"            handle_sync_power_state_max_retries_exceeded(task, power_state,"},{"line_number":2494,"context_line":"                                                         exception_msg\u003dstr(e))"},{"line_number":2495,"context_line":"        else:"},{"line_number":2496,"context_line":"            LOG.warning(_LW(\"During sync_power_state, could not get power \""},{"line_number":2497,"context_line":"                            \"state for node %(node)s, attempt %(attempt)s of \""}],"source_content_type":"text/x-python","patch_set":3,"id":"3a29b11f_53854c57","line":2494,"updated":"2015-10-22 14:26:04.000000000","message":"How about Py2 and non-ascii messages? IMO better to use six.text_type(e), https://github.com/openstack/ironic/blob/master/ironic/common/exception.py#L55-L56","commit_id":"187494fc33454e3df6d2c0f8fb8405df40d14b65"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"29c0ba552f5379d2d7e70816327425e3eb4a8420","unresolved":false,"context_lines":[{"line_number":2491,"context_line":"        if count \u003e max_retries:"},{"line_number":2492,"context_line":"            task.upgrade_lock()"},{"line_number":2493,"context_line":"            handle_sync_power_state_max_retries_exceeded(task, power_state,"},{"line_number":2494,"context_line":"                                                         exception_msg\u003dstr(e))"},{"line_number":2495,"context_line":"        else:"},{"line_number":2496,"context_line":"            LOG.warning(_LW(\"During sync_power_state, could not get power \""},{"line_number":2497,"context_line":"                            \"state for node %(node)s, attempt %(attempt)s of \""}],"source_content_type":"text/x-python","patch_set":3,"id":"3a29b11f_7c3d9bc2","line":2494,"in_reply_to":"3a29b11f_139ef406","updated":"2015-10-23 09:22:14.000000000","message":"fair enuff, yeah I can pass the exception and format can do it :-)","commit_id":"187494fc33454e3df6d2c0f8fb8405df40d14b65"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"c949ba513545750211e4b765c1b6ca78268b3f00","unresolved":false,"context_lines":[{"line_number":2491,"context_line":"        if count \u003e max_retries:"},{"line_number":2492,"context_line":"            task.upgrade_lock()"},{"line_number":2493,"context_line":"            handle_sync_power_state_max_retries_exceeded(task, power_state,"},{"line_number":2494,"context_line":"                                                         exception_msg\u003dstr(e))"},{"line_number":2495,"context_line":"        else:"},{"line_number":2496,"context_line":"            LOG.warning(_LW(\"During sync_power_state, could not get power \""},{"line_number":2497,"context_line":"                            \"state for node %(node)s, attempt %(attempt)s of \""}],"source_content_type":"text/x-python","patch_set":3,"id":"3a29b11f_139ef406","line":2494,"in_reply_to":"3a29b11f_53854c57","updated":"2015-10-22 14:33:24.000000000","message":"I don\u0027t think we should expect non-ascii non-str messages here. But we can drop str() completely and let formatting do its job","commit_id":"187494fc33454e3df6d2c0f8fb8405df40d14b65"},{"author":{"_account_id":7711,"name":"Yuriy Zveryanskyy","email":"yzveryanskyy@mirantis.com","username":"yuriyz"},"change_message_id":"af287fbcf4036d359392e8f93a9364313dc02841","unresolved":false,"context_lines":[{"line_number":2540,"context_line":"        try:"},{"line_number":2541,"context_line":"            # node_power_action will update the node record"},{"line_number":2542,"context_line":"            # so don\u0027t do that again here."},{"line_number":2543,"context_line":"            utils.node_power_action(task, node.power_state)"},{"line_number":2544,"context_line":"        except Exception as e:"},{"line_number":2545,"context_line":"            LOG.error(_LE("},{"line_number":2546,"context_line":"                \"Failed to change power state of node %(node)s \""}],"source_content_type":"text/x-python","patch_set":3,"id":"3a29b11f_f394988b","line":2543,"updated":"2015-10-22 14:26:04.000000000","message":"Will be fine get message for last error from this exception too, maybe save it and move l2529-2531 at the end of function?","commit_id":"187494fc33454e3df6d2c0f8fb8405df40d14b65"},{"author":{"_account_id":11076,"name":"Shivanand Tendulker","email":"stendulker@gmail.com","username":"stendulker"},"change_message_id":"e1df311ccbb74dfb88a230ef10ef376e48982ee1","unresolved":false,"context_lines":[{"line_number":2441,"context_line":"                            \u0027for node %(node)s, switching node to maintenance \u0027"},{"line_number":2442,"context_line":"                            \u0027mode. Error: \"%(error)s\"\u0027) %"},{"line_number":2443,"context_line":"                          {\u0027node\u0027: node.uuid, \u0027error\u0027: exception})"},{"line_number":2444,"context_line":"        LOG.error(last_error_msg)"},{"line_number":2445,"context_line":""},{"line_number":2446,"context_line":"    node.power_state \u003d actual_power_state"},{"line_number":2447,"context_line":"    node.last_error \u003d last_error_msg or msg"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a29b11f_9b93b34f","line":2444,"updated":"2015-10-26 00:18:48.000000000","message":"This will log the similar message twice; here  and at L2451 below. \nCan we make it one ? Something like below so that we do not need any  condition checks below.\nmsg \u003d last_error_msg","commit_id":"e31da8ea84fad9bdcc61c07903be41283a781ae1"},{"author":{"_account_id":14891,"name":"Lilia Sampaio","email":"liliars@lsd.ufcg.edu.br","username":"liliars"},"change_message_id":"aa0dc519a1de182d863e65ade6b8ad8dcef4f0dc","unresolved":false,"context_lines":[{"line_number":2441,"context_line":"                            \u0027for node %(node)s, switching node to maintenance \u0027"},{"line_number":2442,"context_line":"                            \u0027mode. Error: \"%(error)s\"\u0027) %"},{"line_number":2443,"context_line":"                          {\u0027node\u0027: node.uuid, \u0027error\u0027: exception})"},{"line_number":2444,"context_line":"        LOG.error(last_error_msg)"},{"line_number":2445,"context_line":""},{"line_number":2446,"context_line":"    node.power_state \u003d actual_power_state"},{"line_number":2447,"context_line":"    node.last_error \u003d last_error_msg or msg"}],"source_content_type":"text/x-python","patch_set":4,"id":"da85f559_5ce157fd","line":2444,"in_reply_to":"3a29b11f_9b93b34f","updated":"2015-11-10 14:42:33.000000000","message":"I think a previous review asked for these two log messages, which I\u0027m actually fine with because \u0027last_error_msg\u0027 might not even exist, so you can\u0027t make \u0027msg\u0027 and \u0027last_error_msg\u0027 the same thing. Plus, messages are similar, but different. The last error one refers to an exception while \u0027msg\u0027 doesn\u0027t.","commit_id":"e31da8ea84fad9bdcc61c07903be41283a781ae1"},{"author":{"_account_id":13295,"name":"Mario Villaplana","email":"mario.villaplana@gmail.com","username":"mariojv"},"change_message_id":"cd379c1688d8ae22f2c908066dea31b95e869d06","unresolved":false,"context_lines":[{"line_number":2441,"context_line":"                            \u0027for node %(node)s, switching node to maintenance \u0027"},{"line_number":2442,"context_line":"                            \u0027mode. Error: \"%(error)s\"\u0027) %"},{"line_number":2443,"context_line":"                          {\u0027node\u0027: node.uuid, \u0027error\u0027: exception})"},{"line_number":2444,"context_line":"        LOG.error(last_error_msg)"},{"line_number":2445,"context_line":""},{"line_number":2446,"context_line":"    node.power_state \u003d actual_power_state"},{"line_number":2447,"context_line":"    node.last_error \u003d last_error_msg or msg"}],"source_content_type":"text/x-python","patch_set":4,"id":"da85f559_7444591a","line":2444,"in_reply_to":"da85f559_129ad363","updated":"2015-11-10 23:47:37.000000000","message":"I\u0027m fine with keeping both as well.\n\nI think it\u0027s valuable to retain both messages since one refers to the exception while the other denotes updating the DB, which might occur regardless of whether an exception exists. \n\nI could think of a case where someone would want to count the number of times the DB was updated like this independently of whether an exception occurred, which would be easier if the same message (msg) was logged in both cases.","commit_id":"e31da8ea84fad9bdcc61c07903be41283a781ae1"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"af5777769a4e082534452a5d77080531aee3a155","unresolved":false,"context_lines":[{"line_number":2441,"context_line":"                            \u0027for node %(node)s, switching node to maintenance \u0027"},{"line_number":2442,"context_line":"                            \u0027mode. Error: \"%(error)s\"\u0027) %"},{"line_number":2443,"context_line":"                          {\u0027node\u0027: node.uuid, \u0027error\u0027: exception})"},{"line_number":2444,"context_line":"        LOG.error(last_error_msg)"},{"line_number":2445,"context_line":""},{"line_number":2446,"context_line":"    node.power_state \u003d actual_power_state"},{"line_number":2447,"context_line":"    node.last_error \u003d last_error_msg or msg"}],"source_content_type":"text/x-python","patch_set":4,"id":"da85f559_129ad363","line":2444,"in_reply_to":"da85f559_5ce157fd","updated":"2015-11-10 16:21:44.000000000","message":"Exactly, yeah the last error one will log the content of the exception.\n\nI could do some string manipulation and try to fit it all in one log, but I don\u0027t think that\u0027s needed. Lemme know what you think","commit_id":"e31da8ea84fad9bdcc61c07903be41283a781ae1"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"870c900030088ebb8b2d293c5d0b98097610fd89","unresolved":false,"context_lines":[{"line_number":2441,"context_line":"                            \u0027for node %(node)s, switching node to maintenance \u0027"},{"line_number":2442,"context_line":"                            \u0027mode. Error: \"%(error)s\"\u0027) %"},{"line_number":2443,"context_line":"                          {\u0027node\u0027: node.uuid, \u0027error\u0027: exception})"},{"line_number":2444,"context_line":"        LOG.error(last_error_msg)"},{"line_number":2445,"context_line":""},{"line_number":2446,"context_line":"    node.power_state \u003d actual_power_state"},{"line_number":2447,"context_line":"    node.last_error \u003d last_error_msg or msg"}],"source_content_type":"text/x-python","patch_set":4,"id":"da85f559_916a0a80","line":2444,"in_reply_to":"da85f559_7444591a","updated":"2015-11-11 16:29:51.000000000","message":"It seems like this is called when there is an exception AND when max retries were exceeded, so wouldn\u0027t it be useful to combine both in the .last_error()?","commit_id":"e31da8ea84fad9bdcc61c07903be41283a781ae1"}],"ironic/tests/unit/conductor/test_manager.py":[{"author":{"_account_id":14891,"name":"Lilia Sampaio","email":"liliars@lsd.ufcg.edu.br","username":"liliars"},"change_message_id":"37b4f5bde52d7aeace4c52d040e7e828d747ed31","unresolved":false,"context_lines":[{"line_number":2963,"context_line":"        self.service \u003d manager.ConductorManager(\u0027hostname\u0027, \u0027test-topic\u0027)"},{"line_number":2964,"context_line":"        self.driver \u003d mock.Mock(spec_set\u003ddrivers_base.BaseDriver)"},{"line_number":2965,"context_line":"        self.power \u003d self.driver.power"},{"line_number":2966,"context_line":"        self.node \u003d obj_utils.create_test_node("},{"line_number":2967,"context_line":"            self.context, driver\u003d\u0027fake\u0027, maintenance\u003dFalse,"},{"line_number":2968,"context_line":"            provision_state\u003dstates.AVAILABLE)"},{"line_number":2969,"context_line":"        self.task \u003d mock.Mock(spec_set\u003d[\u0027context\u0027, \u0027driver\u0027, \u0027node\u0027,"}],"source_content_type":"text/x-python","patch_set":1,"id":"3a29b11f_f91ee46e","line":2966,"updated":"2015-10-21 17:18:19.000000000","message":"Nice one (:","commit_id":"41e153aa4a0365b5f9a6094e5a6f95dd2848d1df"}]}
