Merge pull request #557 from crawford/azure

oem/azure: fixes for new regions
This commit is contained in:
Alex Crawford 2016-06-11 09:51:21 -07:00 committed by GitHub
commit a71d3af739
2 changed files with 6 additions and 3 deletions

View File

@ -9,12 +9,13 @@ getManagementEndpoint() {
} }
getStorageEndpointPrefix() { getStorageEndpointPrefix() {
azure account env show --environment=$(getAzureEnvironment) --json | \ prefix=$(azure account env show --environment=$(getAzureEnvironment) --json | \
jq '.storageEndpointSuffix' --raw-output jq '.storageEndpointSuffix' --raw-output)
echo "${prefix##.}"
} }
getBlobStorageEndpoint() { getBlobStorageEndpoint() {
echo "blob$(getStorageEndpointPrefix)" echo "blob.$(getStorageEndpointPrefix)"
} }
getSubscriptionId() { getSubscriptionId() {

View File

@ -25,6 +25,7 @@ if [ -z $subscription_id ]; then
subscription_id=$(getSubscriptionId) subscription_id=$(getSubscriptionId)
fi fi
IFS=$'\n'
requestBody="<ReplicationInput xmlns=\"http://schemas.microsoft.com/windowsazure\"> requestBody="<ReplicationInput xmlns=\"http://schemas.microsoft.com/windowsazure\">
<TargetLocations>" <TargetLocations>"
for region in $(getRegions); do for region in $(getRegions); do
@ -38,6 +39,7 @@ requestBody+="
<Version>${VERSION}</Version> <Version>${VERSION}</Version>
</ComputeImageAttributes> </ComputeImageAttributes>
</ReplicationInput>" </ReplicationInput>"
unset IFS
url="$(getManagementEndpoint)/${subscription_id}/services/images/${image_name}/replicate" url="$(getManagementEndpoint)/${subscription_id}/services/images/${image_name}/replicate"