Comment 1 for bug 1744038

Revision history for this message
Ryan Harper (raharper) wrote :

To document my understanding of what happened:

Specifying a mirror URI and no template directs curtin to load the on-disk /etc/apt/sources.list file to be used as the template. The process of turning the apt/sources.list contents into a template uses curtin's default mirror values:

# Default archive mirrors
PRIMARY_ARCH_MIRRORS = {"PRIMARY": "http://archive.ubuntu.com/ubuntu/",
                        "SECURITY": "http://security.ubuntu.com/ubuntu/"}

which include a trailing slash for the mirror value.

Curtin then attempts to match the primary mirror url in the apt/sources.list file and if found, will replace the url with the literal string: $MIRROR which will then later get replaced with the uri value specifed in the yaml.

Since curtin's default primary mirror url included the trailing slash, but the trusty apt/sources.list did not, curtin failed to create a template file which would inject the supplied value.

The fix in the proposed branch relaxes the trailing slash restriction to handle the specific case where the on-disk sources.list is missing a trailing slash.