Skip to content

Commit

Permalink
lxc-ubuntu-cloud: Default to trying released channel
Browse files Browse the repository at this point in the history
This adds a fallback to the daily channel if an image couldn't be found
in the released one.

Signed-off-by: Dimitri John Ledkov <dimitri.ledkov@canonical.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
  • Loading branch information
xnox authored and stgraber committed Jan 21, 2014
1 parent 89addaa commit 4b954f1
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions templates/lxc-ubuntu-cloud.in
Expand Up @@ -189,7 +189,7 @@ hostarch=$arch
cloud=0
locales=1
flushcache=0
stream="released"
stream="tryreleased"
cloneargs=()
while true
do
Expand Down Expand Up @@ -252,8 +252,8 @@ if [ $hostarch = "armhf" -o $hostarch = "armel" ] && \
exit 1
fi

if [ "$stream" != "daily" -a "$stream" != "released" ]; then
echo "Only 'daily' and 'released' streams are supported"
if [ "$stream" != "daily" -a "$stream" != "released" -a "$stream" != "tryreleased" ]; then
echo "Only 'daily' and 'released' and 'tryreleased' streams are supported"
exit 1
fi

Expand Down Expand Up @@ -290,6 +290,11 @@ fi

mkdir -p $cache

if [ "$stream" = "tryreleased" ]; then
stream=released
ubuntu-cloudimg-query $release $stream $arch 1>/dev/null 2>/dev/null || stream=daily
fi

if [ -n "$tarball" ]; then
url2="$tarball"
else
Expand Down

0 comments on commit 4b954f1

Please sign in to comment.