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>
cloud=0
locales=1
flushcache=0
-stream="released"
+stream="tryreleased"
cloneargs=()
while true
do
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
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