)]}'
{"ironic/api/controllers/v1/node.py":[{"author":{"_account_id":6623,"name":"Roman Prykhodchenko","email":"me@romcheg.me","username":"prykhodchenko"},"change_message_id":"42cb380cd411c496430c935892659c15be2f5951","unresolved":false,"context_lines":[{"line_number":219,"context_line":"        return NodeReservation.convert(rpc_node)"},{"line_number":220,"context_line":""},{"line_number":221,"context_line":"    @wsme_pecan.wsexpose(NodeReservation, types.uuid, body\u003dNodeReservation)"},{"line_number":222,"context_line":"    def put(self, node_uuid, reservation):"},{"line_number":223,"context_line":"        \"\"\"Clear reservation of the node."},{"line_number":224,"context_line":""},{"line_number":225,"context_line":"        :param node_uuid: UUID of a node."}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUH%2F9ns4%3D","line":222,"updated":"2014-02-05 16:05:33.000000000","message":"I\u0027m concerned about usage of PUT here. Shouldn\u0027t we use DELETE for clearing the reservation?","commit_id":"6e469aeaf4b61a34093007985e4ae185dd262a50"},{"author":{"_account_id":7711,"name":"Yuriy Zveryanskyy","email":"yzveryanskyy@mirantis.com","username":"yuriyz"},"change_message_id":"fd1ef8cbffbf9b5c27a1929828448dbf33e751b8","unresolved":false,"context_lines":[{"line_number":219,"context_line":"        return NodeReservation.convert(rpc_node)"},{"line_number":220,"context_line":""},{"line_number":221,"context_line":"    @wsme_pecan.wsexpose(NodeReservation, types.uuid, body\u003dNodeReservation)"},{"line_number":222,"context_line":"    def put(self, node_uuid, reservation):"},{"line_number":223,"context_line":"        \"\"\"Clear reservation of the node."},{"line_number":224,"context_line":""},{"line_number":225,"context_line":"        :param node_uuid: UUID of a node."}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUH%2F9h7E%3D","line":222,"in_reply_to":"AAAAUH%2F9ns4%3D","updated":"2014-02-06 09:22:02.000000000","message":"In IRC chat with Lucas there was an idea to use PUT with special body. We can discuss this.","commit_id":"6e469aeaf4b61a34093007985e4ae185dd262a50"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"2d736d0d8888f88264ea634351091f491bb56e05","unresolved":false,"context_lines":[{"line_number":210,"context_line":"class NodeReservationController(rest.RestController):"},{"line_number":211,"context_line":""},{"line_number":212,"context_line":"    @wsme_pecan.wsexpose(NodeReservation, types.uuid)"},{"line_number":213,"context_line":"    def get(self, node_uuid):"},{"line_number":214,"context_line":"        \"\"\"Get reservation of the node."},{"line_number":215,"context_line":""},{"line_number":216,"context_line":"        :param node_uuid: UUID of a node."}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAUX%2F%2FsDs%3D","line":213,"updated":"2014-02-11 14:19:42.000000000","message":"Wondering if it would be redundant to have a GET on this subresource, reservation is already returned when GET\u0027ing the /nodes/\u003cuuid\u003e resource.\n\nI think that we could simplify this code and just add the /reservation to the _custom_action dictionary on the NodesController (see l467), just like we do with validation.","commit_id":"81d5ba4b1d624975bc7bd8fb9b1a6b8c096f1968"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"2d736d0d8888f88264ea634351091f491bb56e05","unresolved":false,"context_lines":[{"line_number":219,"context_line":"        return NodeReservation.convert(rpc_node)"},{"line_number":220,"context_line":""},{"line_number":221,"context_line":"    @wsme_pecan.wsexpose(NodeReservation, types.uuid, body\u003dNodeReservation)"},{"line_number":222,"context_line":"    def put(self, node_uuid, reservation):"},{"line_number":223,"context_line":"        \"\"\"Clear reservation of the node."},{"line_number":224,"context_line":""},{"line_number":225,"context_line":"        :param node_uuid: UUID of a node."}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAUX%2F%2FsDQ%3D","line":222,"updated":"2014-02-11 14:19:42.000000000","message":"hmm I was thinking about romcheg comment and I think DELETE would make sense (I still want to know what other folks might think about it)\n\nDELETE /nodes/\u003cuuid\u003e/reservation","commit_id":"81d5ba4b1d624975bc7bd8fb9b1a6b8c096f1968"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"2d736d0d8888f88264ea634351091f491bb56e05","unresolved":false,"context_lines":[{"line_number":466,"context_line":""},{"line_number":467,"context_line":"    _custom_actions \u003d {"},{"line_number":468,"context_line":"        \u0027detail\u0027: [\u0027GET\u0027],"},{"line_number":469,"context_line":"        \u0027validate\u0027: [\u0027GET\u0027],"},{"line_number":470,"context_line":"    }"},{"line_number":471,"context_line":""},{"line_number":472,"context_line":"    def __init__(self, from_chassis\u003dFalse):"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAUX%2F%2FsDE%3D","line":469,"updated":"2014-02-11 14:19:42.000000000","message":"\u0027reservation\u0027: [\u0027DELETE\u0027]\n\n(assuming we\u0027re going to use DELETE)","commit_id":"81d5ba4b1d624975bc7bd8fb9b1a6b8c096f1968"},{"author":{"_account_id":8125,"name":"Michael Davies","email":"michael@the-davies.net","username":"mrda"},"change_message_id":"c67bbefffd391ed53cc12074ab986655415e38e6","unresolved":false,"context_lines":[{"line_number":633,"context_line":"            raise wsme.exc.ClientSideError(_(\"No reservation to break.\"))"},{"line_number":634,"context_line":""},{"line_number":635,"context_line":"        # only allow the node\u0027s reservation to be cleared if conductor which"},{"line_number":636,"context_line":"        # reserved this node is dead"},{"line_number":637,"context_line":"        conductor \u003d objects.Conductor.get_by_hostname(pecan.request.context,"},{"line_number":638,"context_line":"                                                      rpc_node.reservation)"},{"line_number":639,"context_line":"        limit \u003d (timeutils.utcnow() -"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAUX%2F%2FoQY%3D","line":636,"updated":"2014-02-11 22:01:33.000000000","message":"small nit: I\u0027d prefer this to be reworded as \"Only allow the node\u0027s reservation to be cleared if the conductor that reserved this node is dead\"","commit_id":"a2033eb213506ef2a2d720a5256c0aa6608c54ad"},{"author":{"_account_id":7711,"name":"Yuriy Zveryanskyy","email":"yzveryanskyy@mirantis.com","username":"yuriyz"},"change_message_id":"414d3d3911bde1d625135766df8fb85bfe83bd6f","unresolved":false,"context_lines":[{"line_number":633,"context_line":"            raise wsme.exc.ClientSideError(_(\"No reservation to break.\"))"},{"line_number":634,"context_line":""},{"line_number":635,"context_line":"        # only allow the node\u0027s reservation to be cleared if conductor which"},{"line_number":636,"context_line":"        # reserved this node is dead"},{"line_number":637,"context_line":"        conductor \u003d objects.Conductor.get_by_hostname(pecan.request.context,"},{"line_number":638,"context_line":"                                                      rpc_node.reservation)"},{"line_number":639,"context_line":"        limit \u003d (timeutils.utcnow() -"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAUX%2F%2FiVk%3D","line":636,"in_reply_to":"AAAAUX%2F%2FoQY%3D","updated":"2014-02-12 14:38:24.000000000","message":"Done","commit_id":"a2033eb213506ef2a2d720a5256c0aa6608c54ad"}],"ironic/tests/api/test_nodes.py":[{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"2d736d0d8888f88264ea634351091f491bb56e05","unresolved":false,"context_lines":[{"line_number":765,"context_line":"        ret \u003d self.put_json(\u0027/nodes/%s/reservation\u0027 % self.node.uuid,"},{"line_number":766,"context_line":"                            {\u0027reservation\u0027: \u0027fake\u0027},"},{"line_number":767,"context_line":"                            expect_errors\u003dTrue)"},{"line_number":768,"context_line":"        self.assertEqual(ret.status_code, 400)"},{"line_number":769,"context_line":""},{"line_number":770,"context_line":"    def test_clear_reservation_fails_no_reservation(self):"},{"line_number":771,"context_line":"        ret \u003d self.put_json(\u0027/nodes/%s/reservation\u0027 % self.node.uuid,"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAUX%2F%2Fr%2BQ%3D","line":768,"updated":"2014-02-11 14:19:42.000000000","message":"nit: self.assertEqual(400, ret.status_code)\n\nThe other methods have been fixed by: https://review.openstack.org/#/c/71486/\n\n(same comment apply for the other tests added by this patch)","commit_id":"81d5ba4b1d624975bc7bd8fb9b1a6b8c096f1968"},{"author":{"_account_id":8125,"name":"Michael Davies","email":"michael@the-davies.net","username":"mrda"},"change_message_id":"c67bbefffd391ed53cc12074ab986655415e38e6","unresolved":false,"context_lines":[{"line_number":659,"context_line":"        self.post_json(\u0027/nodes\u0027, ndict)"},{"line_number":660,"context_line":"        response \u003d self.delete(\u0027/nodes/%s\u0027 % ndict[\u0027uuid\u0027], expect_errors\u003dTrue)"},{"line_number":661,"context_line":"        self.assertEqual(409, response.status_int)"},{"line_number":662,"context_line":""},{"line_number":663,"context_line":"    def test_clear_reservation_fails_no_reservation(self):"},{"line_number":664,"context_line":"        ndict \u003d dbutils.get_test_node()"},{"line_number":665,"context_line":"        node \u003d self.dbapi.create_node(ndict)"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAUX%2F%2FoJs%3D","line":662,"updated":"2014-02-11 22:01:33.000000000","message":"For these error cases, can we add checks for the exception raised?  i.e. NodeNotFound, NodeLocked and ClientException are all raised by various calls to delete under various circumstances.  I think we should capture each of these.","commit_id":"a2033eb213506ef2a2d720a5256c0aa6608c54ad"},{"author":{"_account_id":7711,"name":"Yuriy Zveryanskyy","email":"yzveryanskyy@mirantis.com","username":"yuriyz"},"change_message_id":"414d3d3911bde1d625135766df8fb85bfe83bd6f","unresolved":false,"context_lines":[{"line_number":659,"context_line":"        self.post_json(\u0027/nodes\u0027, ndict)"},{"line_number":660,"context_line":"        response \u003d self.delete(\u0027/nodes/%s\u0027 % ndict[\u0027uuid\u0027], expect_errors\u003dTrue)"},{"line_number":661,"context_line":"        self.assertEqual(409, response.status_int)"},{"line_number":662,"context_line":""},{"line_number":663,"context_line":"    def test_clear_reservation_fails_no_reservation(self):"},{"line_number":664,"context_line":"        ndict \u003d dbutils.get_test_node()"},{"line_number":665,"context_line":"        node \u003d self.dbapi.create_node(ndict)"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAUX%2F%2FiVU%3D","line":662,"in_reply_to":"AAAAUX%2F%2FoJs%3D","updated":"2014-02-12 14:38:24.000000000","message":"Done","commit_id":"a2033eb213506ef2a2d720a5256c0aa6608c54ad"},{"author":{"_account_id":8125,"name":"Michael Davies","email":"michael@the-davies.net","username":"mrda"},"change_message_id":"3d298a26f8620ef1566dd3a4d39353cbcb76afd7","unresolved":false,"context_lines":[{"line_number":665,"context_line":"        node \u003d self.dbapi.create_node(ndict)"},{"line_number":666,"context_line":"        ret \u003d self.delete(\u0027/nodes/reservation/%s\u0027 % node.uuid,"},{"line_number":667,"context_line":"                          expect_errors\u003dTrue)"},{"line_number":668,"context_line":"        self.assertEqual(400, ret.status_code)"},{"line_number":669,"context_line":""},{"line_number":670,"context_line":"    def test_clear_reservation_fails_notfound(self):"},{"line_number":671,"context_line":"        ret \u003d self.delete(\u0027/nodes/reservation/%s\u0027 % utils.generate_uuid(),"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAUX%2F%2FfHA%3D","line":668,"updated":"2014-02-12 21:01:44.000000000","message":"If you wanted to, you could add:\n\n    self.assertIn(\u0027No reservation to break.\u0027, ret.json[\u0027error_message\u0027])","commit_id":"9fd589aa4a7dda1f55feadb8f8eb70f8af39e6f4"},{"author":{"_account_id":8125,"name":"Michael Davies","email":"michael@the-davies.net","username":"mrda"},"change_message_id":"3d298a26f8620ef1566dd3a4d39353cbcb76afd7","unresolved":false,"context_lines":[{"line_number":670,"context_line":"    def test_clear_reservation_fails_notfound(self):"},{"line_number":671,"context_line":"        ret \u003d self.delete(\u0027/nodes/reservation/%s\u0027 % utils.generate_uuid(),"},{"line_number":672,"context_line":"                          expect_errors\u003dTrue)"},{"line_number":673,"context_line":"        self.assertEqual(404, ret.status_code)"},{"line_number":674,"context_line":""},{"line_number":675,"context_line":"    @mock.patch.object(timeutils, \u0027utcnow\u0027)"},{"line_number":676,"context_line":"    def test_clear_node_reservation_fails_conductor_active(self, mock_utcnow):"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAUX%2F%2FfGY%3D","line":673,"updated":"2014-02-12 21:01:44.000000000","message":"If you wanted to, you could change this test to:\n\n     def test_clear_reservation_fails_notfound(self):\n        uuid \u003d utils.generate_uuid()\n        exceptstr \u003d \"Node %s could not be found.\" % uuid\n        ret \u003d self.delete(\u0027/nodes/reservation/%s\u0027 % uuid,\n                           expect_errors\u003dTrue)\n        self.assertEqual(404, ret.status_code)\n        self.assertIn(exceptstr, ret.json[\u0027error_message\u0027])","commit_id":"9fd589aa4a7dda1f55feadb8f8eb70f8af39e6f4"},{"author":{"_account_id":8125,"name":"Michael Davies","email":"michael@the-davies.net","username":"mrda"},"change_message_id":"3d298a26f8620ef1566dd3a4d39353cbcb76afd7","unresolved":false,"context_lines":[{"line_number":686,"context_line":"        mock_utcnow.return_value \u003d present"},{"line_number":687,"context_line":"        ret \u003d self.delete(\u0027/nodes/reservation/%s\u0027 % node.uuid,"},{"line_number":688,"context_line":"                          expect_errors\u003dTrue)"},{"line_number":689,"context_line":"        self.assertEqual(400, ret.status_code)"},{"line_number":690,"context_line":""},{"line_number":691,"context_line":"    @mock.patch.object(timeutils, \u0027utcnow\u0027)"},{"line_number":692,"context_line":"    def test_clear_node_reservation_ok(self, mock_utcnow):"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAUX%2F%2FfF4%3D","line":689,"updated":"2014-02-12 21:01:44.000000000","message":"If you wanted to you could add:\n\n    self.assertIn(\u0027Clear node reservation for active conductors not allowed.\u0027, ret.json[\u0027error_message\u0027])","commit_id":"9fd589aa4a7dda1f55feadb8f8eb70f8af39e6f4"},{"author":{"_account_id":8125,"name":"Michael Davies","email":"michael@the-davies.net","username":"mrda"},"change_message_id":"3d298a26f8620ef1566dd3a4d39353cbcb76afd7","unresolved":false,"context_lines":[{"line_number":711,"context_line":"        past \u003d datetime.datetime(2000, 1, 1, 0, 0)"},{"line_number":712,"context_line":"        present \u003d past + datetime.timedelta(minutes\u003d5)"},{"line_number":713,"context_line":"        mock_utcnow.return_value \u003d past"},{"line_number":714,"context_line":"        c \u003d dbutils.get_test_conductor(hostname\u003d\u0027fake\u0027)"},{"line_number":715,"context_line":"        self.dbapi.register_conductor(c)"},{"line_number":716,"context_line":"        ndict \u003d dbutils.get_test_node(id\u003d1, uuid\u003dutils.generate_uuid(),"},{"line_number":717,"context_line":"                                      reservation\u003d\u0027fake-new\u0027)"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAUX%2F%2FfFE%3D","line":714,"updated":"2014-02-12 21:01:44.000000000","message":"If you wanted to, you could change this to:\n\n    host \u003d \u0027fake\u0027\n    host_new \u003d \u0027fake-new\u0027\n    c \u003d dbutils.get_test_conductor(hostname\u003dhost)","commit_id":"9fd589aa4a7dda1f55feadb8f8eb70f8af39e6f4"},{"author":{"_account_id":8125,"name":"Michael Davies","email":"michael@the-davies.net","username":"mrda"},"change_message_id":"3d298a26f8620ef1566dd3a4d39353cbcb76afd7","unresolved":false,"context_lines":[{"line_number":714,"context_line":"        c \u003d dbutils.get_test_conductor(hostname\u003d\u0027fake\u0027)"},{"line_number":715,"context_line":"        self.dbapi.register_conductor(c)"},{"line_number":716,"context_line":"        ndict \u003d dbutils.get_test_node(id\u003d1, uuid\u003dutils.generate_uuid(),"},{"line_number":717,"context_line":"                                      reservation\u003d\u0027fake-new\u0027)"},{"line_number":718,"context_line":"        node \u003d self.dbapi.create_node(ndict)"},{"line_number":719,"context_line":"        node.reservation \u003d \u0027fake\u0027"},{"line_number":720,"context_line":"        mock_utcnow.return_value \u003d present"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAUX%2F%2FfEo%3D","line":717,"updated":"2014-02-12 21:01:44.000000000","message":"and this to:\n\n                                      reservation\u003dhost_new)","commit_id":"9fd589aa4a7dda1f55feadb8f8eb70f8af39e6f4"},{"author":{"_account_id":8125,"name":"Michael Davies","email":"michael@the-davies.net","username":"mrda"},"change_message_id":"3d298a26f8620ef1566dd3a4d39353cbcb76afd7","unresolved":false,"context_lines":[{"line_number":723,"context_line":"            ret \u003d self.delete(\u0027/nodes/reservation/%s\u0027 % node.uuid,"},{"line_number":724,"context_line":"                              expect_errors\u003dTrue)"},{"line_number":725,"context_line":"            self.assertEqual(409, ret.status_code)"},{"line_number":726,"context_line":""},{"line_number":727,"context_line":""},{"line_number":728,"context_line":"class TestPut(base.FunctionalTest):"},{"line_number":729,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAUX%2F%2FfEE%3D","line":726,"updated":"2014-02-12 21:01:44.000000000","message":"And add these:\n\n            except_str \u003d \"Node %s is locked by host %s.\" % (node.uuid, host_new)\n            self.assertIn(except_str, ret.json[\u0027error_message\u0027])","commit_id":"9fd589aa4a7dda1f55feadb8f8eb70f8af39e6f4"}]}
