)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"1c7fe50d44857cac882ed9ba265e6bb97c303f0d","unresolved":false,"context_lines":[{"line_number":10,"context_line":"CONF.database.connection which is passed in as \u0027default\u0027."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"This change ensures that _format_url function will wrap an"},{"line_number":13,"context_line":"IPv6 address \u0027hostname\u0027 in the connection url in brackets."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"NOTE: Test test_formatted_mq_url_multi_netloc1_but_ipv6"},{"line_number":16,"context_line":"  wrapped the IPv6 hostname in the varurl used to format"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"9fb8cfa7_c6d557e7","line":13,"updated":"2019-06-17 13:47:10.000000000","message":"I don\u0027t really understand why you think it\u0027s obvious that your behavior is right and the existing behavior is wrong. You\u0027re tripping over it in the test you modify and mention below, that you can get the brackets in there by putting them in the format.\n\nRegardless, I don\u0027t think it\u0027s reasonable to just make this change blindly at this point. Everyone that has put brackets into their templated cell mapping urls will be screwed by this change and will have to simultaneously roll all control services atomically with a change to the database in order to not cause failures.\n\nIf this is really important, then you probably need to include a new substitution key called \"safe_host\" or something, which always has the brackets done correctly, and encourage people to move over. But just changing this at this point does not seem reasonable to me.","commit_id":"1e52bc716daa320a2e577ef732c2d375177af372"},{"author":{"_account_id":24245,"name":"Harald Jensås","email":"hjensas@redhat.com","username":"harald.jensas"},"change_message_id":"955dbe7db033d1329f91ea446fe4e2854178313a","unresolved":false,"context_lines":[{"line_number":10,"context_line":"CONF.database.connection which is passed in as \u0027default\u0027."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"This change ensures that _format_url function will wrap an"},{"line_number":13,"context_line":"IPv6 address \u0027hostname\u0027 in the connection url in brackets."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"NOTE: Test test_formatted_mq_url_multi_netloc1_but_ipv6"},{"line_number":16,"context_line":"  wrapped the IPv6 hostname in the varurl used to format"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"9fb8cfa7_49bbb871","line":13,"in_reply_to":"9fb8cfa7_69355ca8","updated":"2019-06-17 14:38:17.000000000","message":"Dan, sorry. Let me dig a bit more into \"templated cell mapping urls\".","commit_id":"1e52bc716daa320a2e577ef732c2d375177af372"},{"author":{"_account_id":24245,"name":"Harald Jensås","email":"hjensas@redhat.com","username":"harald.jensas"},"change_message_id":"876f4593f09ea3c39c985aaae7183d5a7e77b758","unresolved":false,"context_lines":[{"line_number":10,"context_line":"CONF.database.connection which is passed in as \u0027default\u0027."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"This change ensures that _format_url function will wrap an"},{"line_number":13,"context_line":"IPv6 address \u0027hostname\u0027 in the connection url in brackets."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"NOTE: Test test_formatted_mq_url_multi_netloc1_but_ipv6"},{"line_number":16,"context_line":"  wrapped the IPv6 hostname in the varurl used to format"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"9fb8cfa7_69355ca8","line":13,"in_reply_to":"9fb8cfa7_c6d557e7","updated":"2019-06-17 14:13:05.000000000","message":"Did you look at the bug?\n\nWe absolutely put brackets in the config url string.\nNova eats the brackets when the URL is parsed using urllib.","commit_id":"1e52bc716daa320a2e577ef732c2d375177af372"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"1c7fe50d44857cac882ed9ba265e6bb97c303f0d","unresolved":false,"context_lines":[{"line_number":14,"context_line":""},{"line_number":15,"context_line":"NOTE: Test test_formatted_mq_url_multi_netloc1_but_ipv6"},{"line_number":16,"context_line":"  wrapped the IPv6 hostname in the varurl used to format"},{"line_number":17,"context_line":"  the result. This does\u0027nt seem right, so it no longer"},{"line_number":18,"context_line":"  does this and the nova.objects.cell_mapping._parse_netloc"},{"line_number":19,"context_line":"  method now includes the brackets in the returned result."},{"line_number":20,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"9fb8cfa7_e692db58","line":17,"range":{"start_line":17,"start_character":19,"end_line":17,"end_character":26},"updated":"2019-06-17 13:47:10.000000000","message":"does not","commit_id":"1e52bc716daa320a2e577ef732c2d375177af372"}],"nova/objects/cell_mapping.py":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"d6888fb62cc385d49cc60860f8f82a37baee4673","unresolved":false,"context_lines":[{"line_number":50,"context_line":"        host_end \u003d hostport.find(\u0027]\u0027)"},{"line_number":51,"context_line":"        if host_end \u003c 0:"},{"line_number":52,"context_line":"            raise ValueError(\u0027Invalid IPv6 URL\u0027)"},{"line_number":53,"context_line":"        these[\u0027hostname\u0027] \u003d hostport[0:host_end + 1]"},{"line_number":54,"context_line":"        these[\u0027port\u0027] \u003d hostport[host_end + 1:]"},{"line_number":55,"context_line":"    elif \u0027:\u0027 in hostport:"},{"line_number":56,"context_line":"        these[\u0027hostname\u0027], these[\u0027port\u0027] \u003d hostport.split(\u0027:\u0027, 1)"}],"source_content_type":"text/x-python","patch_set":2,"id":"9fb8cfa7_3ae35ba6","line":53,"updated":"2019-06-13 11:12:28.000000000","message":"Why do we need this change? I removed it and the new test case still passed to me.","commit_id":"ff83bf30907c9bec18de86fb17394e0db76a8903"},{"author":{"_account_id":24245,"name":"Harald Jensås","email":"hjensas@redhat.com","username":"harald.jensas"},"change_message_id":"1c962d9515c21d042e3cdb3adb455c8552eba68c","unresolved":false,"context_lines":[{"line_number":50,"context_line":"        host_end \u003d hostport.find(\u0027]\u0027)"},{"line_number":51,"context_line":"        if host_end \u003c 0:"},{"line_number":52,"context_line":"            raise ValueError(\u0027Invalid IPv6 URL\u0027)"},{"line_number":53,"context_line":"        these[\u0027hostname\u0027] \u003d hostport[0:host_end + 1]"},{"line_number":54,"context_line":"        these[\u0027port\u0027] \u003d hostport[host_end + 1:]"},{"line_number":55,"context_line":"    elif \u0027:\u0027 in hostport:"},{"line_number":56,"context_line":"        these[\u0027hostname\u0027], these[\u0027port\u0027] \u003d hostport.split(\u0027:\u0027, 1)"}],"source_content_type":"text/x-python","patch_set":2,"id":"9fb8cfa7_a5cad09d","line":53,"in_reply_to":"9fb8cfa7_3ae35ba6","updated":"2019-06-13 12:04:32.000000000","message":"It\u0027s not the new testcase that fails, its the existing testcase that is incorrectly including the brackets in \u0027varurl\u0027, masking this issue.\n\n\nWe need to include the [ and ] in the result. See:\n\u003e\u003e\u003e string \u003d \u0027[string_in_brackets]:port\u0027\n\u003e\u003e\u003e end \u003d string.find(\u0027]\u0027)\n\n\u003e\u003e\u003e string[0:end + 1] \u003c-- Includes the brackets.\n\u0027[string_in_brackets]\u0027\n\n\u003e\u003e\u003e string[1:end] \u003c-- removes the brackets.\n\u0027string_in_brackets\u0027\n\n\n\nThe changed testcase does fail for me if I revert this change.\n\ndiff --git a/nova/objects/cell_mapping.py b/nova/objects/cell_mapping.py\nindex 3f6eea3b5b..32889afb96 100644\n--- a/nova/objects/cell_mapping.py\n+++ b/nova/objects/cell_mapping.py\n@@ -50,7 +50,7 @@ def _parse_netloc(netloc):\n         host_end \u003d hostport.find(\u0027]\u0027)\n         if host_end \u003c 0:\n             raise ValueError(\u0027Invalid IPv6 URL\u0027)\n-        these[\u0027hostname\u0027] \u003d hostport[0:host_end + 1]\n+        these[\u0027hostname\u0027] \u003d hostport[1:host_end]\n         these[\u0027port\u0027] \u003d hostport[host_end + 1:]\n     elif \u0027:\u0027 in hostport:\n         these[\u0027hostname\u0027], these[\u0027port\u0027] \u003d hostport.split(\u0027:\u0027, 1)\n\nnova.tests.unit.objects.test_cell_mapping.TestRemoteCellMappingObject.test_formatted_mq_url_multi_netloc1_but_ipv6\n------------------------------------------------------------------------------------------------------------------\n\nCaptured traceback:\n~~~~~~~~~~~~~~~~~~~\n    b\u0027Traceback (most recent call last):\u0027\n    b\u0027  File \"/home/hjensas/code/nova/.tox/py36/lib/python3.6/site-packages/mock/mock.py\", line 1330, in patched\u0027\n    b\u0027    return func(*args, **keywargs)\u0027\n    b\u0027  File \"/home/hjensas/code/nova/nova/tests/unit/objects/test_cell_mapping.py\", line 210, in test_formatted_mq_url_multi_netloc1_but_ipv6\u0027\n    b\u0027    mapping_obj.transport_url)\u0027\n    b\u0027  File \"/home/hjensas/code/nova/.tox/py36/lib/python3.6/site-packages/testtools/testcase.py\", line 411, in assertEqual\u0027\n    b\u0027    self.assertThat(observed, matcher, message)\u0027\n    b\u0027  File \"/home/hjensas/code/nova/.tox/py36/lib/python3.6/site-packages/testtools/testcase.py\", line 498, in assertThat\u0027\n    b\u0027    raise mismatch_error\u0027\n    b\u0027testtools.matchers._impl.MismatchError: !\u003d:\u0027\n    b\"reference \u003d \u0027rabbit://notbob:n0ts3kret@[1:2::7]:1456/nova?munchies\u003ddoritos\u0026flavor\u003dcoolranch#baz\u0027\"\n    b\"actual    \u003d \u0027rabbit://notbob:n0ts3kret@1:2::7:1456/nova?munchies\u003ddoritos\u0026flavor\u003dcoolranch#baz\u0027\"\n    b\u0027\u0027\n    b\u0027\u0027","commit_id":"ff83bf30907c9bec18de86fb17394e0db76a8903"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"6a054e3ee6a79c9977e85cd4b3433c863b8ba784","unresolved":false,"context_lines":[{"line_number":50,"context_line":"        host_end \u003d hostport.find(\u0027]\u0027)"},{"line_number":51,"context_line":"        if host_end \u003c 0:"},{"line_number":52,"context_line":"            raise ValueError(\u0027Invalid IPv6 URL\u0027)"},{"line_number":53,"context_line":"        these[\u0027hostname\u0027] \u003d hostport[0:host_end + 1]"},{"line_number":54,"context_line":"        these[\u0027port\u0027] \u003d hostport[host_end + 1:]"},{"line_number":55,"context_line":"    elif \u0027:\u0027 in hostport:"},{"line_number":56,"context_line":"        these[\u0027hostname\u0027], these[\u0027port\u0027] \u003d hostport.split(\u0027:\u0027, 1)"}],"source_content_type":"text/x-python","patch_set":2,"id":"9fb8cfa7_fd42980e","line":53,"in_reply_to":"9fb8cfa7_a5cad09d","updated":"2019-06-13 15:26:59.000000000","message":"I see now. Thanks of the explanation.","commit_id":"ff83bf30907c9bec18de86fb17394e0db76a8903"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"d6888fb62cc385d49cc60860f8f82a37baee4673","unresolved":false,"context_lines":[{"line_number":106,"context_line":"                        if netaddr.IPAddress(default_url.hostname).version \u003d\u003d 6"},{"line_number":107,"context_line":"                        else default_url.hostname)"},{"line_number":108,"context_line":"        except netaddr.core.AddrFormatError:"},{"line_number":109,"context_line":"            hostname \u003d default_url.hostname"},{"line_number":110,"context_line":""},{"line_number":111,"context_line":"        subs \u003d {"},{"line_number":112,"context_line":"            \u0027username\u0027: default_url.username,"}],"source_content_type":"text/x-python","patch_set":2,"id":"9fb8cfa7_7a4d533c","line":109,"updated":"2019-06-13 11:12:28.000000000","message":"This code block is pretty similar to what nova.utils.safe_ip_format() uses. Can we reuse that call?","commit_id":"ff83bf30907c9bec18de86fb17394e0db76a8903"},{"author":{"_account_id":24245,"name":"Harald Jensås","email":"hjensas@redhat.com","username":"harald.jensas"},"change_message_id":"1c962d9515c21d042e3cdb3adb455c8552eba68c","unresolved":false,"context_lines":[{"line_number":106,"context_line":"                        if netaddr.IPAddress(default_url.hostname).version \u003d\u003d 6"},{"line_number":107,"context_line":"                        else default_url.hostname)"},{"line_number":108,"context_line":"        except netaddr.core.AddrFormatError:"},{"line_number":109,"context_line":"            hostname \u003d default_url.hostname"},{"line_number":110,"context_line":""},{"line_number":111,"context_line":"        subs \u003d {"},{"line_number":112,"context_line":"            \u0027username\u0027: default_url.username,"}],"source_content_type":"text/x-python","patch_set":2,"id":"9fb8cfa7_e50768c9","line":109,"in_reply_to":"9fb8cfa7_7a4d533c","updated":"2019-06-13 12:04:32.000000000","message":"Excellent, I was\u0027t aware of that method.","commit_id":"ff83bf30907c9bec18de86fb17394e0db76a8903"},{"author":{"_account_id":6926,"name":"Bogdan Dobrelya","email":"bdobreli@redhat.com","username":"bogdando"},"change_message_id":"a4de3fa121aef2c5efe7e9c24f6ef1b61220a24a","unresolved":false,"context_lines":[{"line_number":50,"context_line":"        host_end \u003d hostport.find(\u0027]\u0027)"},{"line_number":51,"context_line":"        if host_end \u003c 0:"},{"line_number":52,"context_line":"            raise ValueError(\u0027Invalid IPv6 URL\u0027)"},{"line_number":53,"context_line":"        these[\u0027hostname\u0027] \u003d hostport[0:host_end +1]"},{"line_number":54,"context_line":"        these[\u0027port\u0027] \u003d hostport[host_end + 1:]"},{"line_number":55,"context_line":"    elif \u0027:\u0027 in hostport:"},{"line_number":56,"context_line":"        these[\u0027hostname\u0027], these[\u0027port\u0027] \u003d hostport.split(\u0027:\u0027, 1)"}],"source_content_type":"text/x-python","patch_set":3,"id":"9fb8cfa7_c0e812b4","line":53,"updated":"2019-06-13 13:16:18.000000000","message":"nit: missing whitespace?","commit_id":"035fbb6f92c0fa60d508d295695063f407881762"},{"author":{"_account_id":24245,"name":"Harald Jensås","email":"hjensas@redhat.com","username":"harald.jensas"},"change_message_id":"68df6059c91aaf2c98dffa524e78e05b3ed5133f","unresolved":false,"context_lines":[{"line_number":50,"context_line":"        host_end \u003d hostport.find(\u0027]\u0027)"},{"line_number":51,"context_line":"        if host_end \u003c 0:"},{"line_number":52,"context_line":"            raise ValueError(\u0027Invalid IPv6 URL\u0027)"},{"line_number":53,"context_line":"        these[\u0027hostname\u0027] \u003d hostport[0:host_end +1]"},{"line_number":54,"context_line":"        these[\u0027port\u0027] \u003d hostport[host_end + 1:]"},{"line_number":55,"context_line":"    elif \u0027:\u0027 in hostport:"},{"line_number":56,"context_line":"        these[\u0027hostname\u0027], these[\u0027port\u0027] \u003d hostport.split(\u0027:\u0027, 1)"}],"source_content_type":"text/x-python","patch_set":3,"id":"9fb8cfa7_49f2069c","line":53,"in_reply_to":"9fb8cfa7_c0e812b4","updated":"2019-06-13 18:51:32.000000000","message":"Done","commit_id":"035fbb6f92c0fa60d508d295695063f407881762"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"1c7fe50d44857cac882ed9ba265e6bb97c303f0d","unresolved":false,"context_lines":[{"line_number":50,"context_line":"        host_end \u003d hostport.find(\u0027]\u0027)"},{"line_number":51,"context_line":"        if host_end \u003c 0:"},{"line_number":52,"context_line":"            raise ValueError(\u0027Invalid IPv6 URL\u0027)"},{"line_number":53,"context_line":"        these[\u0027hostname\u0027] \u003d hostport[0:host_end + 1]"},{"line_number":54,"context_line":"        these[\u0027port\u0027] \u003d hostport[host_end + 1:]"},{"line_number":55,"context_line":"    elif \u0027:\u0027 in hostport:"},{"line_number":56,"context_line":"        these[\u0027hostname\u0027], these[\u0027port\u0027] \u003d hostport.split(\u0027:\u0027, 1)"}],"source_content_type":"text/x-python","patch_set":4,"id":"9fb8cfa7_26823302","line":53,"range":{"start_line":53,"start_character":37,"end_line":53,"end_character":39},"updated":"2019-06-17 13:47:10.000000000","message":"This is very unconventional because the zero is implied. So, remove this and just make it:\n\n hostport[:host_end + 1]","commit_id":"1e52bc716daa320a2e577ef732c2d375177af372"},{"author":{"_account_id":11090,"name":"Sergii Golovatiuk","email":"sgolovat@redhat.com","username":"holser"},"change_message_id":"1a9d6891848f1df89f5357d278f49e29f917f35b","unresolved":false,"context_lines":[{"line_number":44,"context_line":"        userpass, hostport \u003d netloc.split(\u0027@\u0027, 1)"},{"line_number":45,"context_line":"    else:"},{"line_number":46,"context_line":"        hostport \u003d netloc"},{"line_number":47,"context_line":"        userpass \u003d \u0027\u0027"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"    if hostport.startswith(\u0027[\u0027):"},{"line_number":50,"context_line":"        host_end \u003d hostport.find(\u0027]\u0027)"}],"source_content_type":"text/x-python","patch_set":6,"id":"9fb8cfa7_b7263468","line":47,"updated":"2019-06-18 15:53:41.000000000","message":"there can be malformed URL when user:password@/..\n\nwithout IP. so we should strictly verify that there are no / after @","commit_id":"713480e93d8f5cb605088fc29ad7746d9b86f8f4"},{"author":{"_account_id":24245,"name":"Harald Jensås","email":"hjensas@redhat.com","username":"harald.jensas"},"change_message_id":"775e1f34816b6fbe4e3da03095b0fab48855b64e","unresolved":false,"context_lines":[{"line_number":44,"context_line":"        userpass, hostport \u003d netloc.split(\u0027@\u0027, 1)"},{"line_number":45,"context_line":"    else:"},{"line_number":46,"context_line":"        hostport \u003d netloc"},{"line_number":47,"context_line":"        userpass \u003d \u0027\u0027"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"    if hostport.startswith(\u0027[\u0027):"},{"line_number":50,"context_line":"        host_end \u003d hostport.find(\u0027]\u0027)"}],"source_content_type":"text/x-python","patch_set":6,"id":"9fb8cfa7_d2063a21","line":47,"in_reply_to":"9fb8cfa7_b7263468","updated":"2019-06-19 21:18:18.000000000","message":"This is unrelated to this change, so it would be better to address it in a separate patch.","commit_id":"713480e93d8f5cb605088fc29ad7746d9b86f8f4"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"dbcd9aa895999159de0682025c7cf43e06c0fad3","unresolved":false,"context_lines":[{"line_number":131,"context_line":"        else:"},{"line_number":132,"context_line":"            # NOTE(hjensas): Remove brackets from template since we use"},{"line_number":133,"context_line":"            # utils.safe_ip_format() for the hostname."},{"line_number":134,"context_line":"            url \u003d url.replace(\u0027[{hostname}]\u0027, \u0027{hostname}\u0027)"},{"line_number":135,"context_line":""},{"line_number":136,"context_line":"        return url.format(**subs)"},{"line_number":137,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"9fb8cfa7_a6812cc6","line":134,"updated":"2019-06-18 13:51:54.000000000","message":"This won\u0027t work in the case where my template is something like:\n\n mysql://cell1.{hostname}.alttld:{port}\n\nI think what you need to do is what I suggested before, which is to add a safe_hostname key to the subs dict that will (or will not) have the brackets per protocol, so that I can do this:\n\n mysql://{safe_hostname}:{port}\n\nif I\u0027m not doing anything fancy and have the hostname be replaced with either:\n\n [1.2.3.4]\n\nor\n\n [1::2.3.4]\n\ndepending on the protocol. I think my example above is probably a good reason not to ever remove the bare hostname sub key which would be needed if I\u0027m using DNS names and I need to compose them in the template.","commit_id":"713480e93d8f5cb605088fc29ad7746d9b86f8f4"},{"author":{"_account_id":24245,"name":"Harald Jensås","email":"hjensas@redhat.com","username":"harald.jensas"},"change_message_id":"775e1f34816b6fbe4e3da03095b0fab48855b64e","unresolved":false,"context_lines":[{"line_number":131,"context_line":"        else:"},{"line_number":132,"context_line":"            # NOTE(hjensas): Remove brackets from template since we use"},{"line_number":133,"context_line":"            # utils.safe_ip_format() for the hostname."},{"line_number":134,"context_line":"            url \u003d url.replace(\u0027[{hostname}]\u0027, \u0027{hostname}\u0027)"},{"line_number":135,"context_line":""},{"line_number":136,"context_line":"        return url.format(**subs)"},{"line_number":137,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"9fb8cfa7_f2281e98","line":134,"in_reply_to":"9fb8cfa7_a6812cc6","updated":"2019-06-19 21:18:18.000000000","message":"\u003e This won\u0027t work in the case where my template is something like:\n \u003e \n \u003e mysql://cell1.{hostname}.alttld:{port}\n \u003e \n\nI don\u0027t see why this example would fail?\n\u003e\u003e\u003e url \u003d \u0027mysql://cell1.{hostname}.alttld:{port}\u0027\n\u003e\u003e\u003e url.replace(\u0027[{hostname}]\u0027, \u0027{hostname}\u0027)\n\u0027mysql://cell1.{hostname}.alttld:{port}\u0027\n\nIt replaces instances of \u0027[{hostname}]\u0027 with \u0027{hostname}\u0027, so in that case the replace matches nothing, and the url is\u0027nt changed.\n\nIn case the default_url used and IPv6 address, for example \u0027[1:2::7]:123\u0027 your example would result \u0027mysql://cell1.[1:2::7].alttld:123\u0027 which is not a valid fqdn. But, without this change it would result in \u0027mysql://cell1.1:2::7.alttld:123\u0027 which is equally invalid.\n\nA template like: \u0027mysql://cell1.[{hostname}].alttld:{port}\u0027 without this change would result in \u0027mysql://cell1.[somedomain].alttld:123\u0027 which is an invalid fqdn. With this change the result would be mysql://cell1.somedomain.alttld:123, so it would work. Alltough IMO the template is invalid in this case, fqdn\u0027s cannot have brackets so the only reason to use brackets in the template is specifically if an IPv6 address is used in the database_connection config (i.e default_url)?\n\n\n \u003e I think what you need to do is what I suggested before, which is to\n \u003e add a safe_hostname key to the subs dict that will (or will not)\n \u003e have the brackets per protocol, so that I can do this:\n \u003e \n \u003e mysql://{safe_hostname}:{port}\n \u003e \n\nI\u0027d like to avoid patching installer project\u0027s, so I\u0027m not too keen on this. Alltough it would work.\n\n \u003e if I\u0027m not doing anything fancy and have the hostname be replaced\n \u003e with either:\n \u003e \n \u003e [1.2.3.4]\n \u003e \n \u003e or\n \u003e \n \u003e [1::2.3.4]\n \u003e \n \u003e depending on the protocol. I think my example above is probably a\n \u003e good reason not to ever remove the bare hostname sub key which\n \u003e would be needed if I\u0027m using DNS names and I need to compose them\n \u003e in the template.","commit_id":"713480e93d8f5cb605088fc29ad7746d9b86f8f4"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"5b25fcf553d17e3606eaec9f3e41f6b73942d8d6","unresolved":false,"context_lines":[{"line_number":131,"context_line":"        else:"},{"line_number":132,"context_line":"            # NOTE(hjensas): Remove brackets from template since we use"},{"line_number":133,"context_line":"            # utils.safe_ip_format() for the hostname."},{"line_number":134,"context_line":"            url \u003d url.replace(\u0027[{hostname}]\u0027, \u0027{hostname}\u0027)"},{"line_number":135,"context_line":""},{"line_number":136,"context_line":"        return url.format(**subs)"},{"line_number":137,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"9fb8cfa7_dd787e90","line":134,"in_reply_to":"9fb8cfa7_f2281e98","updated":"2019-06-20 14:00:11.000000000","message":"\u003e I\u0027d like to avoid patching installer project\u0027s, so I\u0027m not too keen\n \u003e on this. Alltough it would work.\n\nYou don\u0027t have to, you just have to patch the one you care about. I\u0027m really not okay with a pattern match of how you expect that people have used the hostname subst. It\u0027s already a bit magical, and that behavior, especially if it goes wrong, will be completely invisible and unexplainable by a user.\n\nPlease just add safe_hostname which is properly bracketed, document it in a reno and let people use it if/when they need. This stuff  is encoded in people\u0027s databases *right now* and breaking that in any way when they roll to this (especially after consuming a backport) is not going to be popular.","commit_id":"713480e93d8f5cb605088fc29ad7746d9b86f8f4"}],"releasenotes/notes/bug-1831315-cell-mapping-url-ipv6-brackets-a94a99dcaa1d3ee3.yaml":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"d6888fb62cc385d49cc60860f8f82a37baee4673","unresolved":false,"context_lines":[{"line_number":1,"context_line":"---"},{"line_number":2,"context_line":"fixes:"},{"line_number":3,"context_line":"  - |"},{"line_number":4,"context_line":"    ``nova.objects.cell_mapping.CellMapping._format_url`` now ensure brackets"},{"line_number":5,"context_line":"    (``[]``) wrapping IPv6 addresses in a connection string are included."},{"line_number":6,"context_line":"    (Bug: `1831315 \u003chttps://bugs.launchpad.net/tripleo/+bug/1831315\u003e`_.)"}],"source_content_type":"text/x-yaml","patch_set":2,"id":"9fb8cfa7_9a712779","line":4,"range":{"start_line":4,"start_character":4,"end_line":4,"end_character":57},"updated":"2019-06-13 11:12:28.000000000","message":"That seems too implementation specific for the release note reader. Can we state instead that the what is the configuration format that was broken before but supported now ?","commit_id":"ff83bf30907c9bec18de86fb17394e0db76a8903"},{"author":{"_account_id":24245,"name":"Harald Jensås","email":"hjensas@redhat.com","username":"harald.jensas"},"change_message_id":"1c962d9515c21d042e3cdb3adb455c8552eba68c","unresolved":false,"context_lines":[{"line_number":1,"context_line":"---"},{"line_number":2,"context_line":"fixes:"},{"line_number":3,"context_line":"  - |"},{"line_number":4,"context_line":"    ``nova.objects.cell_mapping.CellMapping._format_url`` now ensure brackets"},{"line_number":5,"context_line":"    (``[]``) wrapping IPv6 addresses in a connection string are included."},{"line_number":6,"context_line":"    (Bug: `1831315 \u003chttps://bugs.launchpad.net/tripleo/+bug/1831315\u003e`_.)"}],"source_content_type":"text/x-yaml","patch_set":2,"id":"9fb8cfa7_85cd4c86","line":4,"range":{"start_line":4,"start_character":4,"end_line":4,"end_character":57},"in_reply_to":"9fb8cfa7_9a712779","updated":"2019-06-13 12:04:32.000000000","message":"Done","commit_id":"ff83bf30907c9bec18de86fb17394e0db76a8903"}]}
