Merge autopkgtest-cloud:mirror-region into autopkgtest-cloud:master

Proposed by Brian Murray
Status: Merged
Merged at revision: 0f12fabaf95f8f0232800091f55ca2c7d1a421a9
Proposed branch: autopkgtest-cloud:mirror-region
Merge into: autopkgtest-cloud:master
Diff against target: 25 lines (+6/-6)
1 file modified
charms/focal/autopkgtest-cloud-worker/autopkgtest-cloud/tools/build-adt-image (+6/-6)
Reviewer Review Type Date Requested Status
Paride Legovini Approve
Ubuntu Release Team Pending
Review via email: mp+438925@code.launchpad.net

Description of the change

Allow using a mirror-$REGION.rc file (e.g. mirror-bos01.rc) on a cloud-worker unit to specify the mirror so that we can use different mirrors for different data centers when necessary. This has the advantage that we will be able to just add / remove a file on the unit and not have to update the charms.

This is a follow up to the failed hack MP in https://code.launchpad.net/~ubuntu-release/autopkgtest-cloud/+git/autopkgtest-cloud/+merge/438808.

To post a comment you must log in.
Revision history for this message
Brian Murray (brian-murray) wrote :

I realize there is a white space change here but it is actually consistent with items later on.

Revision history for this message
Paride Legovini (paride) wrote :

LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/charms/focal/autopkgtest-cloud-worker/autopkgtest-cloud/tools/build-adt-image b/charms/focal/autopkgtest-cloud-worker/autopkgtest-cloud/tools/build-adt-image
2index 640a843..be6b4d3 100755
3--- a/charms/focal/autopkgtest-cloud-worker/autopkgtest-cloud/tools/build-adt-image
4+++ b/charms/focal/autopkgtest-cloud-worker/autopkgtest-cloud/tools/build-adt-image
5@@ -11,14 +11,14 @@ if [ -z "${RELEASE}" ] || [ -z "${REGION}" ] || [ -z "${ARCH}" ]; then
6 exit 1
7 fi
8
9-[ -z "${MIRROR:-}" ] && . ~/mirror.rc
10-export MIRROR
11-
12 if [ -z "${MIRROR:-}" ]; then
13- if [ "${REGION}" == "bos01" ] || [ "${REGION}" == "bos02" ]; then
14- MIRROR=http://us.archive.ubuntu.com/ubuntu/
15- fi
16+ if [ -e ~/mirror-${REGION}.rc ]; then
17+ . ~/mirror-${REGION}.rc
18+ else
19+ . ~/mirror.rc
20+ fi
21 fi
22+export MIRROR
23
24 [ -z "${NET_NAME:-}" ] && . ~/net-name.rc
25 export NET_NAME

Subscribers

People subscribed via source and target branches