From c6ff07a29fe7665eee053ea04e10041437df67e4 Mon Sep 17 00:00:00 2001 From: Alex Crawford Date: Sat, 11 Jun 2016 09:25:58 -0700 Subject: [PATCH 1/2] oem/azure: normalize endpoint prefixes Some regions lead with a '.' and others do not... --- oem/azure/common.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/oem/azure/common.sh b/oem/azure/common.sh index 08e040629f..666e30248e 100644 --- a/oem/azure/common.sh +++ b/oem/azure/common.sh @@ -9,12 +9,13 @@ getManagementEndpoint() { } getStorageEndpointPrefix() { - azure account env show --environment=$(getAzureEnvironment) --json | \ - jq '.storageEndpointSuffix' --raw-output + prefix=$(azure account env show --environment=$(getAzureEnvironment) --json | \ + jq '.storageEndpointSuffix' --raw-output) + echo "${prefix##.}" } getBlobStorageEndpoint() { - echo "blob$(getStorageEndpointPrefix)" + echo "blob.$(getStorageEndpointPrefix)" } getSubscriptionId() { From adf43492033c27242f67567cb1db1638526cbce3 Mon Sep 17 00:00:00 2001 From: Alex Crawford Date: Sat, 11 Jun 2016 09:27:36 -0700 Subject: [PATCH 2/2] oem/azure: split on newlines instead of whitespace Some of the regions have spaces in the name. This causes problems when we build the XML list of regions. --- oem/azure/replicate-image.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/oem/azure/replicate-image.sh b/oem/azure/replicate-image.sh index b47de4634b..0e7c2a851f 100755 --- a/oem/azure/replicate-image.sh +++ b/oem/azure/replicate-image.sh @@ -25,6 +25,7 @@ if [ -z $subscription_id ]; then subscription_id=$(getSubscriptionId) fi +IFS=$'\n' requestBody=" " for region in $(getRegions); do @@ -38,6 +39,7 @@ requestBody+=" ${VERSION} " +unset IFS url="$(getManagementEndpoint)/${subscription_id}/services/images/${image_name}/replicate"