diff options
author | Daniel Watkins <oddbloke@ubuntu.com> | 2020-03-31 13:52:21 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-31 13:52:21 -0400 |
commit | c478d0bff412c67280dfe8f08568de733f9425a1 (patch) | |
tree | a7412d85346b966227c9fbe3fc878a7f61acce58 /cloudinit/tests/helpers.py | |
parent | ed350acb7a941ef16b2f9e19b223b58901e6b431 (diff) | |
download | vyos-cloud-init-c478d0bff412c67280dfe8f08568de733f9425a1.tar.gz vyos-cloud-init-c478d0bff412c67280dfe8f08568de733f9425a1.zip |
distros: replace invalid characters in mirror URLs with hyphens (#291)
This modifies _get_package_mirror_info to convert the hostnames of generated mirror URLs to their IDNA form, and then iterate through them replacing any invalid characters (i.e. anything other than letters, digits or a hyphen) with a hyphen.
This commit introduces the following changes in behaviour:
* generated mirror URLs with Unicode characters in their hostnames will have their hostnames converted to their all-ASCII IDNA form
* generated mirror URLs with invalid-for-hostname characters in their hostname will have those characters converted to hyphens
* generated mirror URLs which cannot be parsed by `urllib.parse.urlsplit` will not be considered for use
* other configured patterns will still be considered
* if all configured patterns fail to produce a URL that parses then the fallback mirror URL will be used
LP: #1868232
Diffstat (limited to 'cloudinit/tests/helpers.py')
0 files changed, 0 insertions, 0 deletions