)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6849,"name":"Roman Podoliaka","email":"roman.podoliaka@gmail.com","username":"rpodolyaka"},"change_message_id":"10db47c00f954a8ecf3374e7555536d060294bb4","unresolved":false,"context_lines":[{"line_number":5,"context_line":"CommitDate: 2015-08-11 17:05:51 +0000"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Parsing of URL corrected"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"When nova-api is run under Apache server(with NOVA_USE_MOD_WSGI\u003dTrue)"},{"line_number":10,"context_line":"some commands fail because of problem with API version parsing."},{"line_number":11,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"1a4dcd0f_cf68e8f7","line":8,"updated":"2015-08-12 17:46:58.000000000","message":"Marian, you should really mention your last comment here to make clear why we need this.","commit_id":"58708cdcd45a7319c61383da9c0cce0e69b8e3af"},{"author":{"_account_id":6062,"name":"jichenjc","email":"jichenjc@cn.ibm.com","username":"jichenjc"},"change_message_id":"0d2e36147dc48d88bf656ce94a17cd4a518809fa","unresolved":false,"context_lines":[{"line_number":11,"context_line":"it becomes possible not to use separate ports for each openstack service but"},{"line_number":12,"context_line":"share 80 port with different URL prefixes. Mailing list thread with"},{"line_number":13,"context_line":"discussion the details of this feature:"},{"line_number":14,"context_line":"http://lists.openstack.org/pipermail/openstack-dev/2015-June/067147.html."},{"line_number":15,"context_line":"Openstack wiki page with mapping urls to services:"},{"line_number":16,"context_line":"https://wiki.openstack.org/wiki/URLs."},{"line_number":17,"context_line":"Function remove_version_from_href was corrected: API version must be present"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":13,"id":"fa1b9901_8c29de8b","line":14,"updated":"2015-08-25 12:18:23.000000000","message":"I suggest to remove the last .\nto make it point to correct link","commit_id":"434ce2a3a84c9593841b3aa3d4e176ce21293b52"}],"nova/api/openstack/common.py":[{"author":{"_account_id":6849,"name":"Roman Podoliaka","email":"roman.podoliaka@gmail.com","username":"rpodolyaka"},"change_message_id":"58b1f0186d0e9abb5e95defa76c210d73c3ec8c0","unresolved":false,"context_lines":[{"line_number":312,"context_line":""},{"line_number":313,"context_line":""},{"line_number":314,"context_line":"def remove_service_prefix_from_href(href):"},{"line_number":315,"context_line":"    \"\"\"Removes service name from the href."},{"line_number":316,"context_line":""},{"line_number":317,"context_line":"    Given: \u0027http://www.nova.com/compute/v1.1/123\u0027"},{"line_number":318,"context_line":"    Returns: \u0027http://www.nova.com/v1.1/123\u0027"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a4dcd0f_92736515","line":315,"updated":"2015-08-04 16:22:30.000000000","message":"nit: can we pass the service name as a function argument? (with a default - \u0027compute\u0027)","commit_id":"567b288a79c90d7c3018fe9acf7d402aa7bc8cf4"},{"author":{"_account_id":14358,"name":"Marian Horban","email":"m.horban@gmail.com","username":"mhorban"},"change_message_id":"5bf4712829abea33193e8856b0eb2b4c75138b87","unresolved":false,"context_lines":[{"line_number":312,"context_line":""},{"line_number":313,"context_line":""},{"line_number":314,"context_line":"def remove_service_prefix_from_href(href):"},{"line_number":315,"context_line":"    \"\"\"Removes service name from the href."},{"line_number":316,"context_line":""},{"line_number":317,"context_line":"    Given: \u0027http://www.nova.com/compute/v1.1/123\u0027"},{"line_number":318,"context_line":"    Returns: \u0027http://www.nova.com/v1.1/123\u0027"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a4dcd0f_0414989d","line":315,"in_reply_to":"1a4dcd0f_92736515","updated":"2015-08-06 07:07:50.000000000","message":"Maybe we need to add config option like \u0027compute_url_prefix\u0027.\nAlso we will need similar url prefixes for ec2-api add metadata.\nWhat is your point of view?","commit_id":"567b288a79c90d7c3018fe9acf7d402aa7bc8cf4"},{"author":{"_account_id":6849,"name":"Roman Podoliaka","email":"roman.podoliaka@gmail.com","username":"rpodolyaka"},"change_message_id":"10db47c00f954a8ecf3374e7555536d060294bb4","unresolved":false,"context_lines":[{"line_number":298,"context_line":"    # NOTE: this should match vX.X or vX"},{"line_number":299,"context_line":"    expression \u003d re.compile(r\u0027^v([0-9]+|[0-9]+\\.[0-9]+)(/.*|$)\u0027)"},{"line_number":300,"context_line":"    # There are two types of supported URLs:"},{"line_number":301,"context_line":"    # 1. URL which contains port number to identify specific service."},{"line_number":302,"context_line":"    # For example:"},{"line_number":303,"context_line":"    #     http://localhost:8774/v2.1/resource"},{"line_number":304,"context_line":"    # 2. URL which contains prefix URL like \u0027compute\u0027 to identify specific"}],"source_content_type":"text/x-python","patch_set":8,"id":"1a4dcd0f_ef7fe4a8","line":301,"updated":"2015-08-12 17:46:58.000000000","message":"I wonder if we do the right thing at all, trying to generate the bookmarks URLs based on the current request URL. What if tomorrow we\u0027ll have a two-part prefix?\n\nAs Jay mentioned on IRC, CONF.osapi_compute_link_prefix must be pretty much all we need to resolve this.","commit_id":"58708cdcd45a7319c61383da9c0cce0e69b8e3af"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"53bdff1e9d0e5ba02c627172b85560641a4f7816","unresolved":false,"context_lines":[{"line_number":282,"context_line":"    return urlparse.urlsplit(\"%s\" % href).path.split(\u0027/\u0027)[-1]"},{"line_number":283,"context_line":""},{"line_number":284,"context_line":""},{"line_number":285,"context_line":"def remove_version_from_href(href):"},{"line_number":286,"context_line":"    \"\"\"Removes the api version from the href."},{"line_number":287,"context_line":""},{"line_number":288,"context_line":"    Given: \u0027http://www.nova.com/compute/v1.1\u0027"}],"source_content_type":"text/x-python","patch_set":12,"id":"fa1b9901_1d0dfa8f","line":285,"updated":"2015-08-19 14:38:59.000000000","message":"To clarify this I would prefer if this was renamed to remove_trailing_version_from_href.\n\nIt appears that this is only used to provide the bookmarks link in a response, so I\u0027m not sure that changes here are going to fail any sort of Tempest test to indicate that what we expected before has changed.  But I do think this warrants a DocImpact in the commit message since it could be changing behavior.","commit_id":"e4cb634225cbd3ddab4a6adffc1de15ebd9eef17"},{"author":{"_account_id":14358,"name":"Marian Horban","email":"m.horban@gmail.com","username":"mhorban"},"change_message_id":"c465304ccdeabfe3e9c48996359fa82b995a2316","unresolved":false,"context_lines":[{"line_number":282,"context_line":"    return urlparse.urlsplit(\"%s\" % href).path.split(\u0027/\u0027)[-1]"},{"line_number":283,"context_line":""},{"line_number":284,"context_line":""},{"line_number":285,"context_line":"def remove_version_from_href(href):"},{"line_number":286,"context_line":"    \"\"\"Removes the api version from the href."},{"line_number":287,"context_line":""},{"line_number":288,"context_line":"    Given: \u0027http://www.nova.com/compute/v1.1\u0027"}],"source_content_type":"text/x-python","patch_set":12,"id":"fa1b9901_7ae5e735","line":285,"in_reply_to":"fa1b9901_1d0dfa8f","updated":"2015-08-20 11:53:10.000000000","message":"Done","commit_id":"e4cb634225cbd3ddab4a6adffc1de15ebd9eef17"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"83df5df71d5fdb0b90757a51aa78b09e00525132","unresolved":false,"context_lines":[{"line_number":301,"context_line":"        LOG.debug(\u0027href %s does not contain version\u0027 % href)"},{"line_number":302,"context_line":"        raise ValueError(_(\u0027href %s does not contain version\u0027) % href)"},{"line_number":303,"context_line":""},{"line_number":304,"context_line":"    new_path \u003d \u0027/\u0027.join(url_parts)"},{"line_number":305,"context_line":""},{"line_number":306,"context_line":"    parsed_url \u003d list(parsed_url)"},{"line_number":307,"context_line":"    parsed_url[2] \u003d new_path"}],"source_content_type":"text/x-python","patch_set":13,"id":"fa1b9901_ac504933","line":304,"updated":"2015-08-25 20:18:25.000000000","message":"I know it was like this before, but it seems really odd to use urlparse.urlsplit() to break the href into components, but that urlparse.urljoin() isn\u0027t used to put them back together. Oh, well, at least it\u0027s better than using os.path.join() as is done further down.","commit_id":"434ce2a3a84c9593841b3aa3d4e176ce21293b52"}],"nova/tests/unit/api/openstack/test_common.py":[{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"605882abf617563e56efe47d99babb68e475daac","unresolved":false,"context_lines":[{"line_number":291,"context_line":"        actual \u003d common.remove_version_from_href(fixture)"},{"line_number":292,"context_line":"        self.assertEqual(actual, expected)"},{"line_number":293,"context_line":""},{"line_number":294,"context_line":"    def test_remove_version_from_href(self):"},{"line_number":295,"context_line":"        fixture \u003d \u0027http://www.testsite.com/v1.1/images\u0027"},{"line_number":296,"context_line":"        expected \u003d \u0027http://www.testsite.com/images\u0027"},{"line_number":297,"context_line":"        actual \u003d common.remove_version_from_href(fixture)"}],"source_content_type":"text/x-python","patch_set":9,"id":"1a4dcd0f_a4dbcd20","side":"PARENT","line":294,"updated":"2015-08-14 17:26:19.000000000","message":"It\u0027s not clear to me why these tests are no longer valid.  Why does the version now need to be at the end of the URL?","commit_id":"05dbd82a10fd9ea1172769c71f2170e359560f59"},{"author":{"_account_id":14358,"name":"Marian Horban","email":"m.horban@gmail.com","username":"mhorban"},"change_message_id":"e4e57c71f85d27f420af04528110b40bd4687177","unresolved":false,"context_lines":[{"line_number":291,"context_line":"        actual \u003d common.remove_version_from_href(fixture)"},{"line_number":292,"context_line":"        self.assertEqual(actual, expected)"},{"line_number":293,"context_line":""},{"line_number":294,"context_line":"    def test_remove_version_from_href(self):"},{"line_number":295,"context_line":"        fixture \u003d \u0027http://www.testsite.com/v1.1/images\u0027"},{"line_number":296,"context_line":"        expected \u003d \u0027http://www.testsite.com/images\u0027"},{"line_number":297,"context_line":"        actual \u003d common.remove_version_from_href(fixture)"}],"source_content_type":"text/x-python","patch_set":9,"id":"fa1b9901_4bd76523","side":"PARENT","line":294,"in_reply_to":"1a4dcd0f_a4dbcd20","updated":"2015-08-18 14:10:02.000000000","message":"Hi Andrew,\nFunction remove_version_from_href() receives SCRIPT_NAME. SCRIPT_NAME consists of concatenation of Apache(or other web server) alias and URL mapping from api-paste.conf. This concatenation is executed in https://github.com/openstack/nova/blob/master/nova/api/openstack/urlmap.py#L179 . As result we can have different URL prefixes but the last part of SCRIPT_NAME is always version of API.\n\nWhy these tests are designed to accept URL where API version is not the latest part but the first part of URL? It is good question. I looked into history and saw that several years ago the logic of function remove_version_from_href() was the same: function expected version of API in the latest part of URL(git show 495137fb).\n\n-def remove_version_from_href(base_url):\n-    return base_url.rsplit(\u0027/\u0027, 1).pop(0)\n\nBut later this code was refactored many times...","commit_id":"05dbd82a10fd9ea1172769c71f2170e359560f59"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"55262a393d4e5b8a27b3997d8ea209ad2f3186a3","unresolved":false,"context_lines":[{"line_number":291,"context_line":"        actual \u003d common.remove_version_from_href(fixture)"},{"line_number":292,"context_line":"        self.assertEqual(actual, expected)"},{"line_number":293,"context_line":""},{"line_number":294,"context_line":"    def test_remove_version_from_href(self):"},{"line_number":295,"context_line":"        fixture \u003d \u0027http://www.testsite.com/v1.1/images\u0027"},{"line_number":296,"context_line":"        expected \u003d \u0027http://www.testsite.com/images\u0027"},{"line_number":297,"context_line":"        actual \u003d common.remove_version_from_href(fixture)"}],"source_content_type":"text/x-python","patch_set":9,"id":"fa1b9901_bf21984f","side":"PARENT","line":294,"in_reply_to":"fa1b9901_4bd76523","updated":"2015-08-18 16:16:35.000000000","message":"This does seem to be on purpose, but its hard to track down why given the bad commit messages back then:\nhttps://github.com/openstack/nova/commit/dd78adbcf0b85f9473b5240af3366fb1dc2d4133","commit_id":"05dbd82a10fd9ea1172769c71f2170e359560f59"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"55262a393d4e5b8a27b3997d8ea209ad2f3186a3","unresolved":false,"context_lines":[{"line_number":299,"context_line":""},{"line_number":300,"context_line":"    def test_remove_version_from_href_3(self):"},{"line_number":301,"context_line":"        fixture \u003d \u0027http://www.testsite.com/v1.1/images/v10.5\u0027"},{"line_number":302,"context_line":"        expected \u003d \u0027http://www.testsite.com/v1.1/images\u0027"},{"line_number":303,"context_line":"        actual \u003d common.remove_version_from_href(fixture)"},{"line_number":304,"context_line":"        self.assertEqual(actual, expected)"},{"line_number":305,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"fa1b9901_2c1004a8","line":302,"updated":"2015-08-18 16:16:35.000000000","message":"That doesn\u0027t seem correct, given the history of this method, why do you need this behaviour?","commit_id":"08fe1b20191b10dcd7c0cf9e1bd3d5622421073e"},{"author":{"_account_id":14358,"name":"Marian Horban","email":"m.horban@gmail.com","username":"mhorban"},"change_message_id":"7526243fcc35332e8b785664f32ae1b98481e55e","unresolved":false,"context_lines":[{"line_number":299,"context_line":""},{"line_number":300,"context_line":"    def test_remove_version_from_href_3(self):"},{"line_number":301,"context_line":"        fixture \u003d \u0027http://www.testsite.com/v1.1/images/v10.5\u0027"},{"line_number":302,"context_line":"        expected \u003d \u0027http://www.testsite.com/v1.1/images\u0027"},{"line_number":303,"context_line":"        actual \u003d common.remove_version_from_href(fixture)"},{"line_number":304,"context_line":"        self.assertEqual(actual, expected)"},{"line_number":305,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"fa1b9901_d92341a6","line":302,"in_reply_to":"fa1b9901_2c1004a8","updated":"2015-08-18 19:38:45.000000000","message":"We must provide ability to start openstack service with any URL prefix(even if part of this prefix looks like API version). Only the latest part of URL can be interpreted as API version.","commit_id":"08fe1b20191b10dcd7c0cf9e1bd3d5622421073e"}]}
