)]}'
{"ironic/conductor/utils.py":[{"author":{"_account_id":10206,"name":"Madhuri Kumari","email":"madhuri.kumari@intel.com","username":"Madhuri"},"change_message_id":"8f0561e165d35910d81b7e0ceb76892d318fc7cb","unresolved":false,"context_lines":[{"line_number":162,"context_line":"    if curr_state \u003d\u003d states.POWER_ON:"},{"line_number":163,"context_line":"        if new_state \u003d\u003d states.POWER_ON:"},{"line_number":164,"context_line":"            _not_going_to_change()"},{"line_number":165,"context_line":"            return True"},{"line_number":166,"context_line":"    elif curr_state \u003d\u003d states.POWER_OFF:"},{"line_number":167,"context_line":"        if new_state in (states.POWER_OFF, states.SOFT_POWER_OFF):"},{"line_number":168,"context_line":"            _not_going_to_change()"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f515b1d_dd382cef","line":165,"range":{"start_line":165,"start_character":12,"end_line":165,"end_character":23},"updated":"2017-09-27 08:38:51.000000000","message":"How about adding this statement to method _not_going_to_change() ?","commit_id":"cce3280fb20de6e1c53bb4fec865b8ad23ccc7f7"},{"author":{"_account_id":10206,"name":"Madhuri Kumari","email":"madhuri.kumari@intel.com","username":"Madhuri"},"change_message_id":"a222bb6df81a585a7cb0332e3b9177aae1d38895","unresolved":false,"context_lines":[{"line_number":162,"context_line":"    if curr_state \u003d\u003d states.POWER_ON:"},{"line_number":163,"context_line":"        if new_state \u003d\u003d states.POWER_ON:"},{"line_number":164,"context_line":"            _not_going_to_change()"},{"line_number":165,"context_line":"            return True"},{"line_number":166,"context_line":"    elif curr_state \u003d\u003d states.POWER_OFF:"},{"line_number":167,"context_line":"        if new_state in (states.POWER_OFF, states.SOFT_POWER_OFF):"},{"line_number":168,"context_line":"            _not_going_to_change()"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f515b1d_e467afe8","line":165,"range":{"start_line":165,"start_character":12,"end_line":165,"end_character":23},"in_reply_to":"7f515b1d_61373101","updated":"2017-09-28 05:52:19.000000000","message":"Yes you\u0027re right. Sorry I missed it :(","commit_id":"cce3280fb20de6e1c53bb4fec865b8ad23ccc7f7"},{"author":{"_account_id":14760,"name":"John L. Villalovos","email":"openstack.org@sodarock.com","username":"jlvillal"},"change_message_id":"c3a7e8e585f18c959c8c90ab42c2d330c81325e4","unresolved":false,"context_lines":[{"line_number":162,"context_line":"    if curr_state \u003d\u003d states.POWER_ON:"},{"line_number":163,"context_line":"        if new_state \u003d\u003d states.POWER_ON:"},{"line_number":164,"context_line":"            _not_going_to_change()"},{"line_number":165,"context_line":"            return True"},{"line_number":166,"context_line":"    elif curr_state \u003d\u003d states.POWER_OFF:"},{"line_number":167,"context_line":"        if new_state in (states.POWER_OFF, states.SOFT_POWER_OFF):"},{"line_number":168,"context_line":"            _not_going_to_change()"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f515b1d_61373101","line":165,"range":{"start_line":165,"start_character":12,"end_line":165,"end_character":23},"in_reply_to":"7f515b1d_a1f76959","updated":"2017-09-28 05:45:29.000000000","message":"Adding it to the method _not_going_to_change() won\u0027t make it return from this function ( _check_if_ignore_state_change() ). Unless I am missing something.\n\nI\u0027m confused.","commit_id":"cce3280fb20de6e1c53bb4fec865b8ad23ccc7f7"},{"author":{"_account_id":10206,"name":"Madhuri Kumari","email":"madhuri.kumari@intel.com","username":"Madhuri"},"change_message_id":"1f96d6ae1c859ac8636d94b3c2c9e6d898cb9558","unresolved":false,"context_lines":[{"line_number":162,"context_line":"    if curr_state \u003d\u003d states.POWER_ON:"},{"line_number":163,"context_line":"        if new_state \u003d\u003d states.POWER_ON:"},{"line_number":164,"context_line":"            _not_going_to_change()"},{"line_number":165,"context_line":"            return True"},{"line_number":166,"context_line":"    elif curr_state \u003d\u003d states.POWER_OFF:"},{"line_number":167,"context_line":"        if new_state in (states.POWER_OFF, states.SOFT_POWER_OFF):"},{"line_number":168,"context_line":"            _not_going_to_change()"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f515b1d_a1f76959","line":165,"range":{"start_line":165,"start_character":12,"end_line":165,"end_character":23},"in_reply_to":"7f515b1d_aa3d192c","updated":"2017-09-28 05:32:25.000000000","message":"Merging two redundant return statement in one statement. Just a minor comment. Feel free to ignore this comment :) if you feel it\u0027s not needed.","commit_id":"cce3280fb20de6e1c53bb4fec865b8ad23ccc7f7"},{"author":{"_account_id":14760,"name":"John L. Villalovos","email":"openstack.org@sodarock.com","username":"jlvillal"},"change_message_id":"3aa2848a89db17e79cde26bb52d1b13d7a272f9d","unresolved":false,"context_lines":[{"line_number":162,"context_line":"    if curr_state \u003d\u003d states.POWER_ON:"},{"line_number":163,"context_line":"        if new_state \u003d\u003d states.POWER_ON:"},{"line_number":164,"context_line":"            _not_going_to_change()"},{"line_number":165,"context_line":"            return True"},{"line_number":166,"context_line":"    elif curr_state \u003d\u003d states.POWER_OFF:"},{"line_number":167,"context_line":"        if new_state in (states.POWER_OFF, states.SOFT_POWER_OFF):"},{"line_number":168,"context_line":"            _not_going_to_change()"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f515b1d_aa3d192c","line":165,"range":{"start_line":165,"start_character":12,"end_line":165,"end_character":23},"in_reply_to":"7f515b1d_dd382cef","updated":"2017-09-27 14:04:41.000000000","message":"Why? How does that improve anything?","commit_id":"cce3280fb20de6e1c53bb4fec865b8ad23ccc7f7"},{"author":{"_account_id":10206,"name":"Madhuri Kumari","email":"madhuri.kumari@intel.com","username":"Madhuri"},"change_message_id":"8f0561e165d35910d81b7e0ceb76892d318fc7cb","unresolved":false,"context_lines":[{"line_number":166,"context_line":"    elif curr_state \u003d\u003d states.POWER_OFF:"},{"line_number":167,"context_line":"        if new_state in (states.POWER_OFF, states.SOFT_POWER_OFF):"},{"line_number":168,"context_line":"            _not_going_to_change()"},{"line_number":169,"context_line":"            return True"},{"line_number":170,"context_line":"    else:"},{"line_number":171,"context_line":"        # if curr_state \u003d\u003d states.ERROR:"},{"line_number":172,"context_line":"        # be optimistic and continue action"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f515b1d_5d2c3cab","line":169,"range":{"start_line":169,"start_character":12,"end_line":169,"end_character":23},"updated":"2017-09-27 08:38:51.000000000","message":"Ditto","commit_id":"cce3280fb20de6e1c53bb4fec865b8ad23ccc7f7"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"74763ae1a2acac94ec31ba81b96b61edcd93b2aa","unresolved":false,"context_lines":[{"line_number":110,"context_line":"    return target_state"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":""},{"line_number":113,"context_line":"def _check_if_ignore_state_change(task, new_state):"},{"line_number":114,"context_line":"    \"\"\"Check if we should ignore the power state change request for the node."},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"    Check if we should ignore the requested power state change. This can occur"}],"source_content_type":"text/x-python","patch_set":7,"id":"7f515b1d_a0c88a21","line":113,"updated":"2017-09-27 22:58:52.000000000","message":"that\u0027s quite a mouthful. we seem to use \u0027check\u0027 to raise an exception, not return a Bool. Although I suspect we aren\u0027t consistent on that.\n\nWhat about \u0027can_skip_state_change\u0027 ? can_ignore_state_change?","commit_id":"283c105cd00da559400a3b57473b56ec9f0a04cf"},{"author":{"_account_id":14760,"name":"John L. Villalovos","email":"openstack.org@sodarock.com","username":"jlvillal"},"change_message_id":"f7d755a59eaa21feb4d15397c3fe2f845b7ee5f3","unresolved":false,"context_lines":[{"line_number":110,"context_line":"    return target_state"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":""},{"line_number":113,"context_line":"def _check_if_ignore_state_change(task, new_state):"},{"line_number":114,"context_line":"    \"\"\"Check if we should ignore the power state change request for the node."},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"    Check if we should ignore the requested power state change. This can occur"}],"source_content_type":"text/x-python","patch_set":7,"id":"7f515b1d_403d56db","line":113,"in_reply_to":"7f515b1d_a0c88a21","updated":"2017-09-27 23:08:29.000000000","message":"Thanks, I like it. I was trying to think up a good name for this function and failing...","commit_id":"283c105cd00da559400a3b57473b56ec9f0a04cf"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"74763ae1a2acac94ec31ba81b96b61edcd93b2aa","unresolved":false,"context_lines":[{"line_number":114,"context_line":"    \"\"\"Check if we should ignore the power state change request for the node."},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"    Check if we should ignore the requested power state change. This can occur"},{"line_number":117,"context_line":"    if the requested power state is already the same as our current state."},{"line_number":118,"context_line":""},{"line_number":119,"context_line":"    :param task: a TaskManager instance containing the node to act on."},{"line_number":120,"context_line":"    :param new_state: Any power state from ironic.common.states."}],"source_content_type":"text/x-python","patch_set":7,"id":"7f515b1d_00f87e78","line":117,"updated":"2017-09-27 22:58:52.000000000","message":"basically, if the node is already in the requested power state, then there\u0027s no need to put it in that state, right? :) It only works for power on/off though; might be worth mentioning that.","commit_id":"283c105cd00da559400a3b57473b56ec9f0a04cf"},{"author":{"_account_id":14760,"name":"John L. Villalovos","email":"openstack.org@sodarock.com","username":"jlvillal"},"change_message_id":"f7d755a59eaa21feb4d15397c3fe2f845b7ee5f3","unresolved":false,"context_lines":[{"line_number":114,"context_line":"    \"\"\"Check if we should ignore the power state change request for the node."},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"    Check if we should ignore the requested power state change. This can occur"},{"line_number":117,"context_line":"    if the requested power state is already the same as our current state."},{"line_number":118,"context_line":""},{"line_number":119,"context_line":"    :param task: a TaskManager instance containing the node to act on."},{"line_number":120,"context_line":"    :param new_state: Any power state from ironic.common.states."}],"source_content_type":"text/x-python","patch_set":7,"id":"7f515b1d_c0282698","line":117,"in_reply_to":"7f515b1d_00f87e78","updated":"2017-09-27 23:08:29.000000000","message":"Correct. And I can add that.","commit_id":"283c105cd00da559400a3b57473b56ec9f0a04cf"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"74763ae1a2acac94ec31ba81b96b61edcd93b2aa","unresolved":false,"context_lines":[{"line_number":117,"context_line":"    if the requested power state is already the same as our current state."},{"line_number":118,"context_line":""},{"line_number":119,"context_line":"    :param task: a TaskManager instance containing the node to act on."},{"line_number":120,"context_line":"    :param new_state: Any power state from ironic.common.states."},{"line_number":121,"context_line":"    :returns: True if should ignore the requested power state change. False"},{"line_number":122,"context_line":"              otherwise"},{"line_number":123,"context_line":"    \"\"\""}],"source_content_type":"text/x-python","patch_set":7,"id":"7f515b1d_00cf5e56","line":120,"updated":"2017-09-27 22:58:52.000000000","message":"this is the \u0027requested power state\u0027 mentioned above?","commit_id":"283c105cd00da559400a3b57473b56ec9f0a04cf"},{"author":{"_account_id":14760,"name":"John L. Villalovos","email":"openstack.org@sodarock.com","username":"jlvillal"},"change_message_id":"f7d755a59eaa21feb4d15397c3fe2f845b7ee5f3","unresolved":false,"context_lines":[{"line_number":117,"context_line":"    if the requested power state is already the same as our current state."},{"line_number":118,"context_line":""},{"line_number":119,"context_line":"    :param task: a TaskManager instance containing the node to act on."},{"line_number":120,"context_line":"    :param new_state: Any power state from ironic.common.states."},{"line_number":121,"context_line":"    :returns: True if should ignore the requested power state change. False"},{"line_number":122,"context_line":"              otherwise"},{"line_number":123,"context_line":"    \"\"\""}],"source_content_type":"text/x-python","patch_set":7,"id":"7f515b1d_a01bea7e","line":120,"in_reply_to":"7f515b1d_00cf5e56","updated":"2017-09-27 23:08:29.000000000","message":"Correct","commit_id":"283c105cd00da559400a3b57473b56ec9f0a04cf"}],"ironic/tests/unit/conductor/test_utils.py":[{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"0f45b78d7e0ec8f995788b895eefdd560bd60b3a","unresolved":false,"context_lines":[{"line_number":618,"context_line":"            get_power_mock.assert_called_once_with(mock.ANY)"},{"line_number":619,"context_line":"            self.assertEqual(states.POWER_ON, node[\u0027power_state\u0027])"},{"line_number":620,"context_line":"            self.assertIsNone(node[\u0027target_power_state\u0027])"},{"line_number":621,"context_line":"            self.assertEqual(states.NOSTATE, node[\u0027last_error\u0027])"},{"line_number":622,"context_line":"            mock_log.warning.assert_called_once_with("},{"line_number":623,"context_line":"                u\"Not going to change node %(node)s power state because \""},{"line_number":624,"context_line":"                u\"current state \u003d requested state \u003d \u0027%(state)s\u0027.\","}],"source_content_type":"text/x-python","patch_set":7,"id":"7f515b1d_83059813","line":621,"updated":"2017-09-27 23:19:28.000000000","message":"hmm, I think s/states.NOSTATE/None/\n\nso self.assertIsNone(node[..])","commit_id":"283c105cd00da559400a3b57473b56ec9f0a04cf"},{"author":{"_account_id":14760,"name":"John L. Villalovos","email":"openstack.org@sodarock.com","username":"jlvillal"},"change_message_id":"294e01bce233c25e38064d2ae0f7f6a763fee371","unresolved":false,"context_lines":[{"line_number":618,"context_line":"            get_power_mock.assert_called_once_with(mock.ANY)"},{"line_number":619,"context_line":"            self.assertEqual(states.POWER_ON, node[\u0027power_state\u0027])"},{"line_number":620,"context_line":"            self.assertIsNone(node[\u0027target_power_state\u0027])"},{"line_number":621,"context_line":"            self.assertEqual(states.NOSTATE, node[\u0027last_error\u0027])"},{"line_number":622,"context_line":"            mock_log.warning.assert_called_once_with("},{"line_number":623,"context_line":"                u\"Not going to change node %(node)s power state because \""},{"line_number":624,"context_line":"                u\"current state \u003d requested state \u003d \u0027%(state)s\u0027.\","}],"source_content_type":"text/x-python","patch_set":7,"id":"7f515b1d_c3b27049","line":621,"in_reply_to":"7f515b1d_83059813","updated":"2017-09-27 23:23:10.000000000","message":"But the code sets it to states.NOSTATE. I should not be then determining that states.NOSTATE is None and then making it None. What if at some point we change states.NOSTATE \u003d \"NOSTATE\"?","commit_id":"283c105cd00da559400a3b57473b56ec9f0a04cf"},{"author":{"_account_id":14760,"name":"John L. Villalovos","email":"openstack.org@sodarock.com","username":"jlvillal"},"change_message_id":"cb306f3b4f967cd1a1e2cd646282f6f2f441507b","unresolved":false,"context_lines":[{"line_number":618,"context_line":"            get_power_mock.assert_called_once_with(mock.ANY)"},{"line_number":619,"context_line":"            self.assertEqual(states.POWER_ON, node[\u0027power_state\u0027])"},{"line_number":620,"context_line":"            self.assertIsNone(node[\u0027target_power_state\u0027])"},{"line_number":621,"context_line":"            self.assertEqual(states.NOSTATE, node[\u0027last_error\u0027])"},{"line_number":622,"context_line":"            mock_log.warning.assert_called_once_with("},{"line_number":623,"context_line":"                u\"Not going to change node %(node)s power state because \""},{"line_number":624,"context_line":"                u\"current state \u003d requested state \u003d \u0027%(state)s\u0027.\","}],"source_content_type":"text/x-python","patch_set":7,"id":"7f515b1d_63329c60","line":621,"in_reply_to":"7f515b1d_a3de540e","updated":"2017-09-28 00:01:47.000000000","message":"Argh, you are correct. I was supposed to do it on line 620 because of: https://review.openstack.org/#/c/507668/7/ironic/conductor/utils.py@140\n\nThanks!","commit_id":"283c105cd00da559400a3b57473b56ec9f0a04cf"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"b995a8a6a163dcc9995288ec4965347a0972ca0e","unresolved":false,"context_lines":[{"line_number":618,"context_line":"            get_power_mock.assert_called_once_with(mock.ANY)"},{"line_number":619,"context_line":"            self.assertEqual(states.POWER_ON, node[\u0027power_state\u0027])"},{"line_number":620,"context_line":"            self.assertIsNone(node[\u0027target_power_state\u0027])"},{"line_number":621,"context_line":"            self.assertEqual(states.NOSTATE, node[\u0027last_error\u0027])"},{"line_number":622,"context_line":"            mock_log.warning.assert_called_once_with("},{"line_number":623,"context_line":"                u\"Not going to change node %(node)s power state because \""},{"line_number":624,"context_line":"                u\"current state \u003d requested state \u003d \u0027%(state)s\u0027.\","}],"source_content_type":"text/x-python","patch_set":7,"id":"7f515b1d_a3de540e","line":621,"in_reply_to":"7f515b1d_c3b27049","updated":"2017-09-27 23:56:12.000000000","message":"huh? This is last_error. I don\u0027t see it being set to states.NOSTATE.\n\nYou have it right at L653","commit_id":"283c105cd00da559400a3b57473b56ec9f0a04cf"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"0f45b78d7e0ec8f995788b895eefdd560bd60b3a","unresolved":false,"context_lines":[{"line_number":677,"context_line":"            self.assertIsNotNone(node[\u0027last_error\u0027])"},{"line_number":678,"context_line":""},{"line_number":679,"context_line":"    @mock.patch(\u0027ironic.objects.node.NodeSetPowerStateNotification\u0027)"},{"line_number":680,"context_line":"    def test__check_if_ignore_state_change_failed_getting_state_notify("},{"line_number":681,"context_line":"            self, mock_notif):"},{"line_number":682,"context_line":"        \"\"\"Test for notification when we can\u0027t get the current power state.\"\"\""},{"line_number":683,"context_line":"        self.config(notification_level\u003d\u0027info\u0027)"}],"source_content_type":"text/x-python","patch_set":7,"id":"7f515b1d_e347ac4b","line":680,"updated":"2017-09-27 23:19:28.000000000","message":"what do you think about getting rid of the test at L655, it looks like a subset of this one.","commit_id":"283c105cd00da559400a3b57473b56ec9f0a04cf"},{"author":{"_account_id":14760,"name":"John L. Villalovos","email":"openstack.org@sodarock.com","username":"jlvillal"},"change_message_id":"294e01bce233c25e38064d2ae0f7f6a763fee371","unresolved":false,"context_lines":[{"line_number":677,"context_line":"            self.assertIsNotNone(node[\u0027last_error\u0027])"},{"line_number":678,"context_line":""},{"line_number":679,"context_line":"    @mock.patch(\u0027ironic.objects.node.NodeSetPowerStateNotification\u0027)"},{"line_number":680,"context_line":"    def test__check_if_ignore_state_change_failed_getting_state_notify("},{"line_number":681,"context_line":"            self, mock_notif):"},{"line_number":682,"context_line":"        \"\"\"Test for notification when we can\u0027t get the current power state.\"\"\""},{"line_number":683,"context_line":"        self.config(notification_level\u003d\u0027info\u0027)"}],"source_content_type":"text/x-python","patch_set":7,"id":"7f515b1d_838a3867","line":680,"in_reply_to":"7f515b1d_e347ac4b","updated":"2017-09-27 23:23:10.000000000","message":"Sure","commit_id":"283c105cd00da559400a3b57473b56ec9f0a04cf"}]}
