)]}'
{"nova/api/openstack/compute/views/servers.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"bf6b405f8b0d2fd13b00cacd19e3eac1aee2af50","unresolved":false,"context_lines":[{"line_number":80,"context_line":"            },"},{"line_number":81,"context_line":"        }"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"    def basic(self, request, instance, show_extra_specs\u003dFalse):"},{"line_number":84,"context_line":"        \"\"\"Generic, non-detailed view of an instance.\"\"\""},{"line_number":85,"context_line":"        return {"},{"line_number":86,"context_line":"            \"server\": {"}],"source_content_type":"text/x-python","patch_set":2,"id":"7f515b1d_7a4368b0","line":83,"updated":"2017-09-27 19:27:29.000000000","message":"This change is unnecessary since we don\u0027t show the embedded flavor during GET /servers. Although I guess this is here because of how _list_view is used?","commit_id":"9c7ba5ba4078c0dfa1f551001517c7b6af9c7509"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"d3863788e5bae9183fd41ee560677019a4c23cff","unresolved":false,"context_lines":[{"line_number":80,"context_line":"            },"},{"line_number":81,"context_line":"        }"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"    def basic(self, request, instance, show_extra_specs\u003dFalse):"},{"line_number":84,"context_line":"        \"\"\"Generic, non-detailed view of an instance.\"\"\""},{"line_number":85,"context_line":"        return {"},{"line_number":86,"context_line":"            \"server\": {"}],"source_content_type":"text/x-python","patch_set":2,"id":"7f515b1d_fa163855","line":83,"in_reply_to":"7f515b1d_7a4368b0","updated":"2017-09-27 19:34:00.000000000","message":"Yes, because we call this way it from non-detail.","commit_id":"9c7ba5ba4078c0dfa1f551001517c7b6af9c7509"},{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"41e47a297d3b1861ea7b3f0ffd8c4252e3143d48","unresolved":false,"context_lines":[{"line_number":119,"context_line":"        ip_v6 \u003d instance.get(\u0027access_ip_v6\u0027)"},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"        if show_extra_specs is None:"},{"line_number":122,"context_line":"            # index will pre-calculate this for us. If we\u0027re doing show,"},{"line_number":123,"context_line":"            # then figure it out here."},{"line_number":124,"context_line":"            show_extra_specs \u003d False"},{"line_number":125,"context_line":"            if api_version_request.is_supported(request, min_version\u003d\u00272.47\u0027):"}],"source_content_type":"text/x-python","patch_set":2,"id":"7f515b1d_9af18498","line":122,"range":{"start_line":122,"start_character":14,"end_line":122,"end_character":19},"updated":"2017-09-27 19:29:24.000000000","message":"This is slightly confusing since index() won\u0027t hit it at all, and it\u0027s detail() that will precalculate it.","commit_id":"9c7ba5ba4078c0dfa1f551001517c7b6af9c7509"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"bf6b405f8b0d2fd13b00cacd19e3eac1aee2af50","unresolved":false,"context_lines":[{"line_number":119,"context_line":"        ip_v6 \u003d instance.get(\u0027access_ip_v6\u0027)"},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"        if show_extra_specs is None:"},{"line_number":122,"context_line":"            # index will pre-calculate this for us. If we\u0027re doing show,"},{"line_number":123,"context_line":"            # then figure it out here."},{"line_number":124,"context_line":"            show_extra_specs \u003d False"},{"line_number":125,"context_line":"            if api_version_request.is_supported(request, min_version\u003d\u00272.47\u0027):"}],"source_content_type":"text/x-python","patch_set":2,"id":"7f515b1d_9a74e4ff","line":122,"range":{"start_line":122,"start_character":14,"end_line":122,"end_character":19},"updated":"2017-09-27 19:27:29.000000000","message":"detail\n\nindex \u003d GET /servers which doesn\u0027t include the embedded flavor.","commit_id":"9c7ba5ba4078c0dfa1f551001517c7b6af9c7509"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"bf6b405f8b0d2fd13b00cacd19e3eac1aee2af50","unresolved":false,"context_lines":[{"line_number":180,"context_line":"        \"\"\"Show a list of servers without many details.\"\"\""},{"line_number":181,"context_line":"        coll_name \u003d self._collection_name"},{"line_number":182,"context_line":"        return self._list_view(self.basic, request, instances, coll_name,"},{"line_number":183,"context_line":"                               False)"},{"line_number":184,"context_line":""},{"line_number":185,"context_line":"    def detail(self, request, instances):"},{"line_number":186,"context_line":"        \"\"\"Detailed view of a list of instance.\"\"\""}],"source_content_type":"text/x-python","patch_set":2,"id":"7f515b1d_1a8114c4","line":183,"updated":"2017-09-27 19:27:29.000000000","message":"Don\u0027t think we need this, although I guess it\u0027s for how _list_view works now, and would be needed for detail below which uses self.show which takes that parameter.","commit_id":"9c7ba5ba4078c0dfa1f551001517c7b6af9c7509"}],"nova/tests/unit/api/openstack/compute/test_serversV21.py":[{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"41e47a297d3b1861ea7b3f0ffd8c4252e3143d48","unresolved":false,"context_lines":[{"line_number":1710,"context_line":"        # we authorize for extra-specs"},{"line_number":1711,"context_line":"        def fake_auth(context, action, target):"},{"line_number":1712,"context_line":"            if \u0027extra-specs\u0027 in action:"},{"line_number":1713,"context_line":"                hits.append(1)"},{"line_number":1714,"context_line":"            return real_auth(context, action, target)"},{"line_number":1715,"context_line":""},{"line_number":1716,"context_line":"        with mock.patch(\u0027nova.policy.authorize\u0027) as mock_auth:"}],"source_content_type":"text/x-python","patch_set":2,"id":"7f515b1d_9aa98425","line":1713,"range":{"start_line":1713,"start_character":16,"end_line":1713,"end_character":30},"updated":"2017-09-27 19:29:24.000000000","message":"just curious, is this more reliable than incrementing an integer here?","commit_id":"9c7ba5ba4078c0dfa1f551001517c7b6af9c7509"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"d3863788e5bae9183fd41ee560677019a4c23cff","unresolved":false,"context_lines":[{"line_number":1710,"context_line":"        # we authorize for extra-specs"},{"line_number":1711,"context_line":"        def fake_auth(context, action, target):"},{"line_number":1712,"context_line":"            if \u0027extra-specs\u0027 in action:"},{"line_number":1713,"context_line":"                hits.append(1)"},{"line_number":1714,"context_line":"            return real_auth(context, action, target)"},{"line_number":1715,"context_line":""},{"line_number":1716,"context_line":"        with mock.patch(\u0027nova.policy.authorize\u0027) as mock_auth:"}],"source_content_type":"text/x-python","patch_set":2,"id":"7f515b1d_f50be920","line":1713,"range":{"start_line":1713,"start_character":16,"end_line":1713,"end_character":30},"in_reply_to":"7f515b1d_9aa98425","updated":"2017-09-27 19:34:00.000000000","message":"It ensures that we don\u0027t have hits in our scope and is a pretty common pattern when we\u0027re setting state in our parent from a closure in a test like this. Might not be necessary in this case, it\u0027s just habit.","commit_id":"9c7ba5ba4078c0dfa1f551001517c7b6af9c7509"},{"author":{"_account_id":2750,"name":"Sean Dague","email":"sean@dague.net","username":"sdague"},"change_message_id":"ce125ccc548ac67aa0dc7d01abb53044a5cd3766","unresolved":false,"context_lines":[{"line_number":1715,"context_line":""},{"line_number":1716,"context_line":"        with mock.patch(\u0027nova.policy.authorize\u0027) as mock_auth:"},{"line_number":1717,"context_line":"            mock_auth.side_effect \u003d fake_auth"},{"line_number":1718,"context_line":"            res_dict \u003d self.controller.detail(req)"},{"line_number":1719,"context_line":""},{"line_number":1720,"context_line":"        self.assertEqual(1, len(hits))"},{"line_number":1721,"context_line":"        for i, s in enumerate(res_dict[\u0027servers\u0027]):"}],"source_content_type":"text/x-python","patch_set":2,"id":"7f515b1d_5ac0ace1","line":1718,"updated":"2017-09-27 19:27:40.000000000","message":"Because all the resource setup is in a base class, there is actually nothing in this test that requires there is \u003e 1 server in the list.\n\nWe should probably guard against that because the number of servers could be refactored out from under us.","commit_id":"9c7ba5ba4078c0dfa1f551001517c7b6af9c7509"},{"author":{"_account_id":2750,"name":"Sean Dague","email":"sean@dague.net","username":"sdague"},"change_message_id":"dc0080602be633d7c9928c73586b0e93accdafb2","unresolved":false,"context_lines":[{"line_number":1711,"context_line":"        def fake_auth(context, action, target):"},{"line_number":1712,"context_line":"            if \u0027extra-specs\u0027 in action:"},{"line_number":1713,"context_line":"                hits.append(1)"},{"line_number":1714,"context_line":"            return real_auth(context, action, target)"},{"line_number":1715,"context_line":""},{"line_number":1716,"context_line":"        with mock.patch(\u0027nova.policy.authorize\u0027) as mock_auth:"},{"line_number":1717,"context_line":"            mock_auth.side_effect \u003d fake_auth"}],"source_content_type":"text/x-python","patch_set":3,"id":"7f515b1d_d54c6d43","line":1714,"updated":"2017-09-27 19:42:48.000000000","message":"An alternative to this would be the following inside the context:\n\n            self.assertEqual(len(mock_auth.mock_calls), 2)\n            self.assertEqual(\n                mock_auth.mock_calls[0],\n                mock.call(mock.ANY,\n                          \u0027os_compute_api:servers:detail\u0027, mock.ANY))\n            self.assertEqual(\n                mock_auth.mock_calls[1],\n                mock.call(mock.ANY,\n                          \u0027os_compute_api:os-flavor-extra-specs:index\u0027,\n                          mock.ANY))\n\nSo it\u0027s a little more direct on what policy calls are getting made.\n\nBut this works.","commit_id":"4aa8215a0b083d68a058ee9b10515ad69286139b"}]}
