← Back to team overview

canonical-ubuntu-qa team mailing list archive

[Merge] autopkgtest-cloud:b-a-i-net-name-regions into autopkgtest-cloud:master

 

Brian Murray has proposed merging autopkgtest-cloud:b-a-i-net-name-regions into autopkgtest-cloud:master.

Requested reviews:
  Canonical's Ubuntu QA (canonical-ubuntu-qa)

For more details, see:
https://code.launchpad.net/~ubuntu-release/autopkgtest-cloud/+git/autopkgtest-cloud/+merge/460139

bos03 in PS6 doesn't have a `net_prod-proposed-migration` but that shouldn't stop us from being able to use it! This modifies build-adt-image to check for region and arch specific variations of the net-name file.

I have cowboy'ed this in production and it worked well.
-- 
Your team Canonical's Ubuntu QA is requested to review the proposed merge of autopkgtest-cloud:b-a-i-net-name-regions into autopkgtest-cloud:master.
diff --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
index b80ec6e..bd9006c 100755
--- a/charms/focal/autopkgtest-cloud-worker/autopkgtest-cloud/tools/build-adt-image
+++ b/charms/focal/autopkgtest-cloud-worker/autopkgtest-cloud/tools/build-adt-image
@@ -21,7 +21,15 @@ if [ -z "${MIRROR:-}" ]; then
 fi
 export MIRROR
 
-[ -z "${NET_NAME:-}" ] && . ~/net-name.rc
+if [ -z "${NET_NAME:-}" ]; then
+        if [ -e ~/net-name-"${REGION}"-"${ARCH}".rc ]; then
+                . ~/net-name-"${REGION}"-"${ARCH}".rc
+        elif [ -e ~/net-name-"${REGION}".rc ]; then
+                . ~/net-name-"${REGION}".rc
+        else
+                . ~/net-name.rc
+        fi
+fi
 export NET_NAME
 
 if [ -z "${USE_CLOUD_CONFIG_FROM_ENV:-}" ]; then