]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
lxc-ubuntu-cloud: Default to trying released channel
authorDimitri John Ledkov <dimitri.ledkov@canonical.com>
Fri, 13 Dec 2013 21:41:44 +0000 (21:41 +0000)
committerStéphane Graber <stgraber@ubuntu.com>
Tue, 21 Jan 2014 03:00:32 +0000 (22:00 -0500)
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>
templates/lxc-ubuntu-cloud.in

index 7a3c8c3fd122c89b832f5128508d6c40b8d1a2bf..42ee563fe4ac50f5abaf218431070c15f01c6501 100644 (file)
@@ -189,7 +189,7 @@ hostarch=$arch
 cloud=0
 locales=1
 flushcache=0
-stream="released"
+stream="tryreleased"
 cloneargs=()
 while true
 do
@@ -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
 
@@ -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