)]}'
{"ironic/api/controllers/v1/node.py":[{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"fed7b95771d4d3f35e0a9d87cdae578fb5b7d569","unresolved":false,"context_lines":[{"line_number":164,"context_line":"        else:"},{"line_number":165,"context_line":"            msg \u003d (_(\"Invalid state \u0027%(state)s\u0027 requested for node %(node)s.\")"},{"line_number":166,"context_line":"                   % {\u0027state\u0027: target, \u0027node\u0027: node_uuid})"},{"line_number":167,"context_line":"            LOG.exception(msg)"},{"line_number":168,"context_line":"            raise wsme.exc.ClientSideError(msg, status_code\u003d400)"},{"line_number":169,"context_line":"        # FIXME(lucasagomes): Currently WSME doesn\u0027t support returning"},{"line_number":170,"context_line":"        # the Location header. Once it\u0027s implemented we should use the"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUH%2F%2F6Ts%3D","side":"PARENT","line":167,"updated":"2014-01-06 21:59:35.000000000","message":"You decided not to log the exception?","commit_id":"5ec1e5f3a1dda26ea5b1eee4e3716dc9f6267fa5"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"375f4e433b07bdfb5bf7f3b73be9e53ce1662ca4","unresolved":false,"context_lines":[{"line_number":164,"context_line":"        else:"},{"line_number":165,"context_line":"            msg \u003d (_(\"Invalid state \u0027%(state)s\u0027 requested for node %(node)s.\")"},{"line_number":166,"context_line":"                   % {\u0027state\u0027: target, \u0027node\u0027: node_uuid})"},{"line_number":167,"context_line":"            LOG.exception(msg)"},{"line_number":168,"context_line":"            raise wsme.exc.ClientSideError(msg, status_code\u003d400)"},{"line_number":169,"context_line":"        # FIXME(lucasagomes): Currently WSME doesn\u0027t support returning"},{"line_number":170,"context_line":"        # the Location header. Once it\u0027s implemented we should use the"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUH%2F%2F2Tg%3D","side":"PARENT","line":167,"in_reply_to":"AAAAUH%2F%2F5Bw%3D","updated":"2014-01-07 18:13:58.000000000","message":"Actually I removed because the user will have the immediately feedback about what went wrong if he request an invalid state, so I don\u0027t think we would need to log it.","commit_id":"5ec1e5f3a1dda26ea5b1eee4e3716dc9f6267fa5"},{"author":{"_account_id":8106,"name":"Haomeng,Wang","email":"wanghaomeng@gmail.com","username":"whaom"},"change_message_id":"f0227917577e2b84fcd23838191a79865a30743c","unresolved":false,"context_lines":[{"line_number":164,"context_line":"        else:"},{"line_number":165,"context_line":"            msg \u003d (_(\"Invalid state \u0027%(state)s\u0027 requested for node %(node)s.\")"},{"line_number":166,"context_line":"                   % {\u0027state\u0027: target, \u0027node\u0027: node_uuid})"},{"line_number":167,"context_line":"            LOG.exception(msg)"},{"line_number":168,"context_line":"            raise wsme.exc.ClientSideError(msg, status_code\u003d400)"},{"line_number":169,"context_line":"        # FIXME(lucasagomes): Currently WSME doesn\u0027t support returning"},{"line_number":170,"context_line":"        # the Location header. Once it\u0027s implemented we should use the"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUH%2F%2F5Bw%3D","side":"PARENT","line":167,"in_reply_to":"AAAAUH%2F%2F6Ts%3D","updated":"2014-01-07 06:17:33.000000000","message":"Ruby, I think the new exception message will be auto-logged with exceptions.","commit_id":"5ec1e5f3a1dda26ea5b1eee4e3716dc9f6267fa5"},{"author":{"_account_id":8106,"name":"Haomeng,Wang","email":"wanghaomeng@gmail.com","username":"whaom"},"change_message_id":"f0227917577e2b84fcd23838191a79865a30743c","unresolved":false,"context_lines":[{"line_number":103,"context_line":"        \"\"\"Set the power state of the node."},{"line_number":104,"context_line":""},{"line_number":105,"context_line":"        :param node_uuid: UUID of a node."},{"line_number":106,"context_line":"        :param target: The desired power state of the node."},{"line_number":107,"context_line":"        \"\"\""},{"line_number":108,"context_line":"        # TODO(lucasagomes): Test if target is a valid state and if it\u0027s able"},{"line_number":109,"context_line":"        # to transition to the target state from the current one"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUH%2F%2F5Ng%3D","line":106,"updated":"2014-01-07 06:17:33.000000000","message":"Lucas, we invovled new InvalidStateRequested exception in this API, so how do you think should we add it into the method comments to reflect the code logic?\n\n:raises: InvalidStateRequested if the input target is not in (POWER_ON, POWER_OFF, REBOOT)","commit_id":"e85e600f2e76b615b4e4f1ef5cdc1abf1f0aa84a"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"375f4e433b07bdfb5bf7f3b73be9e53ce1662ca4","unresolved":false,"context_lines":[{"line_number":103,"context_line":"        \"\"\"Set the power state of the node."},{"line_number":104,"context_line":""},{"line_number":105,"context_line":"        :param node_uuid: UUID of a node."},{"line_number":106,"context_line":"        :param target: The desired power state of the node."},{"line_number":107,"context_line":"        \"\"\""},{"line_number":108,"context_line":"        # TODO(lucasagomes): Test if target is a valid state and if it\u0027s able"},{"line_number":109,"context_line":"        # to transition to the target state from the current one"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUH%2F%2F2S4%3D","line":106,"in_reply_to":"AAAAUH%2F%2F5Ng%3D","updated":"2014-01-07 18:13:58.000000000","message":"good idea :)\n\ndone.","commit_id":"e85e600f2e76b615b4e4f1ef5cdc1abf1f0aa84a"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"fed7b95771d4d3f35e0a9d87cdae578fb5b7d569","unresolved":false,"context_lines":[{"line_number":106,"context_line":"        :param target: The desired power state of the node."},{"line_number":107,"context_line":"        \"\"\""},{"line_number":108,"context_line":"        # TODO(lucasagomes): Test if target is a valid state and if it\u0027s able"},{"line_number":109,"context_line":"        # to transition to the target state from the current one"},{"line_number":110,"context_line":"        rpc_node \u003d objects.Node.get_by_uuid(pecan.request.context, node_uuid)"},{"line_number":111,"context_line":"        if rpc_node.target_power_state is not None:"},{"line_number":112,"context_line":"            raise wsme.exc.ClientSideError(_(\"Power operation for node %s is \""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUH%2F%2F6S8%3D","line":109,"updated":"2014-01-06 21:59:35.000000000","message":"Don\u0027t know if you want to modify this TODO comment, since this change does the \u0027Test if target is valid state\u0027 part :-)","commit_id":"e85e600f2e76b615b4e4f1ef5cdc1abf1f0aa84a"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"375f4e433b07bdfb5bf7f3b73be9e53ce1662ca4","unresolved":false,"context_lines":[{"line_number":106,"context_line":"        :param target: The desired power state of the node."},{"line_number":107,"context_line":"        \"\"\""},{"line_number":108,"context_line":"        # TODO(lucasagomes): Test if target is a valid state and if it\u0027s able"},{"line_number":109,"context_line":"        # to transition to the target state from the current one"},{"line_number":110,"context_line":"        rpc_node \u003d objects.Node.get_by_uuid(pecan.request.context, node_uuid)"},{"line_number":111,"context_line":"        if rpc_node.target_power_state is not None:"},{"line_number":112,"context_line":"            raise wsme.exc.ClientSideError(_(\"Power operation for node %s is \""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUH%2F%2F2Tc%3D","line":109,"in_reply_to":"AAAAUH%2F%2F6S8%3D","updated":"2014-01-07 18:13:58.000000000","message":"done.","commit_id":"e85e600f2e76b615b4e4f1ef5cdc1abf1f0aa84a"},{"author":{"_account_id":8106,"name":"Haomeng,Wang","email":"wanghaomeng@gmail.com","username":"whaom"},"change_message_id":"f0227917577e2b84fcd23838191a79865a30743c","unresolved":false,"context_lines":[{"line_number":142,"context_line":"        of the requested action."},{"line_number":143,"context_line":""},{"line_number":144,"context_line":"        :param node_uuid: UUID of a node."},{"line_number":145,"context_line":"        :param target: The desired provision state of the node."},{"line_number":146,"context_line":""},{"line_number":147,"context_line":"        \"\"\""},{"line_number":148,"context_line":"        rpc_node \u003d objects.Node.get_by_uuid(pecan.request.context, node_uuid)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUH%2F%2F5Mk%3D","line":145,"updated":"2014-01-07 06:17:33.000000000","message":"ditto","commit_id":"e85e600f2e76b615b4e4f1ef5cdc1abf1f0aa84a"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"053245644975d60b6c218a526e8a2325ad8dcf71","unresolved":false,"context_lines":[{"line_number":104,"context_line":""},{"line_number":105,"context_line":"        :param node_uuid: UUID of a node."},{"line_number":106,"context_line":"        :param target: The desired power state of the node."},{"line_number":107,"context_line":"        :raises: InvalidStateRequested (HTTP 409) if the requested target"},{"line_number":108,"context_line":"                 state is not valid."},{"line_number":109,"context_line":""},{"line_number":110,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUH%2F%2F0n8%3D","line":107,"updated":"2014-01-08 02:48:15.000000000","message":"Is it HTTP status code 400, not 409? Your test shows 400. Ditto for provision() below.","commit_id":"94e7f37113514b5185dabc4348643dd75ea5424f"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"6be2109c94fb99ade72dd58389f277ecdbc55e75","unresolved":false,"context_lines":[{"line_number":104,"context_line":""},{"line_number":105,"context_line":"        :param node_uuid: UUID of a node."},{"line_number":106,"context_line":"        :param target: The desired power state of the node."},{"line_number":107,"context_line":"        :raises: InvalidStateRequested (HTTP 409) if the requested target"},{"line_number":108,"context_line":"                 state is not valid."},{"line_number":109,"context_line":""},{"line_number":110,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUH%2F%2Fx%2Fw%3D","line":107,"in_reply_to":"AAAAUH%2F%2F0UM%3D","updated":"2014-01-08 14:58:39.000000000","message":"@Ruby Ops! Indeed it\u0027s 400 Bad Request, I think I was thinking about my other patch to remove the race condition when requesting a power state change for a node when coding it heh. Thanks for pointing it out!\n\n@Haomeng: Great, thanks, will change it :)","commit_id":"94e7f37113514b5185dabc4348643dd75ea5424f"},{"author":{"_account_id":8106,"name":"Haomeng,Wang","email":"wanghaomeng@gmail.com","username":"whaom"},"change_message_id":"515e3f11fdfb3f8b2f9d3057762c896818ee453e","unresolved":false,"context_lines":[{"line_number":104,"context_line":""},{"line_number":105,"context_line":"        :param node_uuid: UUID of a node."},{"line_number":106,"context_line":"        :param target: The desired power state of the node."},{"line_number":107,"context_line":"        :raises: InvalidStateRequested (HTTP 409) if the requested target"},{"line_number":108,"context_line":"                 state is not valid."},{"line_number":109,"context_line":""},{"line_number":110,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUH%2F%2F0UM%3D","line":107,"in_reply_to":"AAAAUH%2F%2F0n8%3D","updated":"2014-01-08 05:19:26.000000000","message":"Yes, should be 400, InvalidStateRequested inherits from Invalid, IronicException with HTTP 400:\n\nhttps://github.com/openstack/ironic/blob/master/ironic/common/exception.py#L118\n\nFor ClientSideError exception case, it should be 409 in L 118 as below.\n\nSo we can list them as below for API documents:\n\n\n    :rsises: ClientSideError (HTTP 400) if the requested node Power operation is in progress.\n    :raises: InvalidStateRequested (HTTP 409) if the requested target","commit_id":"94e7f37113514b5185dabc4348643dd75ea5424f"},{"author":{"_account_id":8106,"name":"Haomeng,Wang","email":"wanghaomeng@gmail.com","username":"whaom"},"change_message_id":"515e3f11fdfb3f8b2f9d3057762c896818ee453e","unresolved":false,"context_lines":[{"line_number":148,"context_line":"        :param target: The desired provision state of the node."},{"line_number":149,"context_line":"        :raises: InvalidStateRequested (HTTP 409) if the requested target"},{"line_number":150,"context_line":"                 state is not valid."},{"line_number":151,"context_line":""},{"line_number":152,"context_line":"        \"\"\""},{"line_number":153,"context_line":"        rpc_node \u003d objects.Node.get_by_uuid(pecan.request.context, node_uuid)"},{"line_number":154,"context_line":"        if rpc_node.target_provision_state is not None:"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUH%2F%2F0UI%3D","line":151,"updated":"2014-01-08 05:19:26.000000000","message":"Lucas, how do you think if this below should be better for our API documents?\n\n\n    :rsises: ClientSideError (HTTP400) if the requested node is already in the target state.\n    :raises: InvalidStateRequested (HTTP 409) if the requested target","commit_id":"94e7f37113514b5185dabc4348643dd75ea5424f"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"6be2109c94fb99ade72dd58389f277ecdbc55e75","unresolved":false,"context_lines":[{"line_number":148,"context_line":"        :param target: The desired provision state of the node."},{"line_number":149,"context_line":"        :raises: InvalidStateRequested (HTTP 409) if the requested target"},{"line_number":150,"context_line":"                 state is not valid."},{"line_number":151,"context_line":""},{"line_number":152,"context_line":"        \"\"\""},{"line_number":153,"context_line":"        rpc_node \u003d objects.Node.get_by_uuid(pecan.request.context, node_uuid)"},{"line_number":154,"context_line":"        if rpc_node.target_provision_state is not None:"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUH%2F%2Fx%2Fs%3D","line":151,"in_reply_to":"AAAAUH%2F%2F0UI%3D","updated":"2014-01-08 14:58:39.000000000","message":"done","commit_id":"94e7f37113514b5185dabc4348643dd75ea5424f"}],"ironic/tests/api/test_nodes.py":[{"author":{"_account_id":8106,"name":"Haomeng,Wang","email":"wanghaomeng@gmail.com","username":"whaom"},"change_message_id":"515e3f11fdfb3f8b2f9d3057762c896818ee453e","unresolved":false,"context_lines":[{"line_number":680,"context_line":"        ret \u003d self.put_json(\u0027/nodes/%s/states/provision\u0027 % self.node.uuid,"},{"line_number":681,"context_line":"                            {\u0027target\u0027: states.ACTIVE})"},{"line_number":682,"context_line":"        self.assertEqual(ret.status_code, 202)"},{"line_number":683,"context_line":"        self.mock_dnd.assert_called_once_with(mock.ANY, self.node.uuid)"},{"line_number":684,"context_line":""},{"line_number":685,"context_line":"    def test_provision_with_tear_down(self):"},{"line_number":686,"context_line":"        ret \u003d self.put_json(\u0027/nodes/%s/states/provision\u0027 % self.node.uuid,"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUH%2F%2F0TU%3D","line":683,"updated":"2014-01-08 05:19:26.000000000","message":"Lucas,\n\nHow do you think should we add more test methods to cover provision API with new InvalidStateRequested exceptions involved by this patch?","commit_id":"94e7f37113514b5185dabc4348643dd75ea5424f"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"6be2109c94fb99ade72dd58389f277ecdbc55e75","unresolved":false,"context_lines":[{"line_number":680,"context_line":"        ret \u003d self.put_json(\u0027/nodes/%s/states/provision\u0027 % self.node.uuid,"},{"line_number":681,"context_line":"                            {\u0027target\u0027: states.ACTIVE})"},{"line_number":682,"context_line":"        self.assertEqual(ret.status_code, 202)"},{"line_number":683,"context_line":"        self.mock_dnd.assert_called_once_with(mock.ANY, self.node.uuid)"},{"line_number":684,"context_line":""},{"line_number":685,"context_line":"    def test_provision_with_tear_down(self):"},{"line_number":686,"context_line":"        ret \u003d self.put_json(\u0027/nodes/%s/states/provision\u0027 % self.node.uuid,"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUH%2F%2Fx%2FU%3D","line":683,"in_reply_to":"AAAAUH%2F%2F0TU%3D","updated":"2014-01-08 14:58:39.000000000","message":"Oh it\u0027s already done on L691 :) thanks for the suggestion","commit_id":"94e7f37113514b5185dabc4348643dd75ea5424f"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"6be2109c94fb99ade72dd58389f277ecdbc55e75","unresolved":false,"context_lines":[{"line_number":688,"context_line":"        self.assertEqual(ret.status_code, 202)"},{"line_number":689,"context_line":"        self.mock_dntd.assert_called_once_with(mock.ANY, self.node.uuid)"},{"line_number":690,"context_line":""},{"line_number":691,"context_line":"    def test_provision_invalid_state_request(self):"},{"line_number":692,"context_line":"        ret \u003d self.put_json(\u0027/nodes/%s/states/provision\u0027 % self.node.uuid,"},{"line_number":693,"context_line":"                            {\u0027target\u0027: \u0027not-supported\u0027}, expect_errors\u003dTrue)"},{"line_number":694,"context_line":"        self.assertEqual(ret.status_code, 400)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUH%2F%2Fx%2Fg%3D","line":691,"updated":"2014-01-08 14:58:39.000000000","message":"here","commit_id":"94e7f37113514b5185dabc4348643dd75ea5424f"}]}
