mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-08-16 00:15:01 +00:00
lxc-ubuntu-cloud.in: re-enable use of daily cloud images
There are two types of cloud images - released and daily ones. We were always using daily ones, instead of using released by default with an option for daily. Fix that. Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com> Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
This commit is contained in:
parent
3eecde703e
commit
427bffc7a1
@ -105,6 +105,7 @@ Generic Options
|
|||||||
[ -C | --cloud ]: Configure container for use with meta-data service, defaults to no
|
[ -C | --cloud ]: Configure container for use with meta-data service, defaults to no
|
||||||
[ -T | --tarball ]: Location of tarball
|
[ -T | --tarball ]: Location of tarball
|
||||||
[ -d | --debug ]: Run with 'set -x' to debug errors
|
[ -d | --debug ]: Run with 'set -x' to debug errors
|
||||||
|
[ -s | --stream]: Use specified stream rather than 'released'
|
||||||
|
|
||||||
Options, mutually exclusive of "-C" and "--cloud":
|
Options, mutually exclusive of "-C" and "--cloud":
|
||||||
[ -i | --hostid ]: HostID for cloud-init, defaults to random string
|
[ -i | --hostid ]: HostID for cloud-init, defaults to random string
|
||||||
@ -116,7 +117,7 @@ EOF
|
|||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
options=$(getopt -o a:hp:r:n:Fi:CLS:T:d -l arch:,help,path:,release:,name:,flush-cache,hostid:,auth-key:,cloud,no_locales,tarball:,debug -- "$@")
|
options=$(getopt -o a:hp:r:n:Fi:CLS:T:ds: -l arch:,help,path:,release:,name:,flush-cache,hostid:,auth-key:,cloud,no_locales,tarball:,debug,stream: -- "$@")
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
usage $(basename $0)
|
usage $(basename $0)
|
||||||
exit 1
|
exit 1
|
||||||
@ -160,6 +161,7 @@ hostarch=$arch
|
|||||||
cloud=0
|
cloud=0
|
||||||
locales=1
|
locales=1
|
||||||
flushcache=0
|
flushcache=0
|
||||||
|
stream="released"
|
||||||
while true
|
while true
|
||||||
do
|
do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
@ -176,6 +178,7 @@ do
|
|||||||
-L|--no_locales) locales=0; shift 2;;
|
-L|--no_locales) locales=0; shift 2;;
|
||||||
-T|--tarball) tarball=$2; shift 2;;
|
-T|--tarball) tarball=$2; shift 2;;
|
||||||
-d|--debug) debug=1; shift 1;;
|
-d|--debug) debug=1; shift 1;;
|
||||||
|
-s|--stream) stream=$2; shift 2;;
|
||||||
--) shift 1; break ;;
|
--) shift 1; break ;;
|
||||||
*) break ;;
|
*) break ;;
|
||||||
esac
|
esac
|
||||||
@ -199,6 +202,11 @@ if [ $arch != "i386" -a $arch != "amd64" ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ "$stream" != "daily" -a "$stream" != "released" ]; then
|
||||||
|
echo "Only 'daily' and 'released' streams are supported"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -z "$path" ]; then
|
if [ -z "$path" ]; then
|
||||||
echo "'path' parameter is required"
|
echo "'path' parameter is required"
|
||||||
exit 1
|
exit 1
|
||||||
@ -223,7 +231,7 @@ mkdir -p $cache
|
|||||||
if [ -n "$tarball" ]; then
|
if [ -n "$tarball" ]; then
|
||||||
url2="$tarball"
|
url2="$tarball"
|
||||||
else
|
else
|
||||||
url1=`ubuntu-cloudimg-query $release released $arch --format "%{url}\n"`
|
url1=`ubuntu-cloudimg-query $release $stream $arch --format "%{url}\n"`
|
||||||
url2=`echo $url1 | sed -e 's/.tar.gz/-root\0/'`
|
url2=`echo $url1 | sed -e 's/.tar.gz/-root\0/'`
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user