~ubuntu-branches/ubuntu/precise/lxc/precise-201203170940

« back to all changes in this revision

Viewing changes to debian/patches/0059-reenable-daily-cloudimg

  • Committer: Serge Hallyn
  • Date: 2012-03-16 15:54:43 UTC
  • Revision ID: serge.hallyn@ubuntu.com-20120316155443-1h2sg3blnf3521s9
Tags: 0.7.5-3ubuntu39
0059-reenable-daily-cloudimg: let user specify daily cloud images.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Description: re-enable use of daily cloud images
 
2
 There are two types of cloud images - released and daily ones.  We were
 
3
 always using daily ones, instead of using released by default with an
 
4
 option for daily.  Fix that.
 
5
Author: Serge Hallyn <serge.hallyn@ubuntu.com>
 
6
Forwarded: yes
 
7
 
 
8
Index: lxc/templates/lxc-ubuntu-cloud.in
 
9
===================================================================
 
10
--- lxc.orig/templates/lxc-ubuntu-cloud.in      2012-03-16 09:40:19.027008000 -0500
 
11
+++ lxc/templates/lxc-ubuntu-cloud.in   2012-03-16 09:49:47.882037866 -0500
 
12
@@ -105,6 +105,7 @@
 
13
 [ -C | --cloud ]: Configure container for use with meta-data service, defaults to no
 
14
 [ -T | --tarball ]: Location of tarball
 
15
 [ -d | --debug ]: Run with 'set -x' to debug errors
 
16
+[ -s | --stream]: Use specified stream rather than 'released'
 
17
 
 
18
 Options, mutually exclusive of "-C" and "--cloud":
 
19
   [ -i | --hostid ]:    HostID for cloud-init, defaults to random string
 
20
@@ -116,7 +117,7 @@
 
21
     return 0
 
22
 }
 
23
 
 
24
-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 -- "$@")
 
25
+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: -- "$@")
 
26
 if [ $? -ne 0 ]; then
 
27
     usage $(basename $0)
 
28
     exit 1
 
29
@@ -160,6 +161,7 @@
 
30
 cloud=0
 
31
 locales=1
 
32
 flushcache=0
 
33
+stream="released"
 
34
 while true
 
35
 do
 
36
     case "$1" in
 
37
@@ -176,6 +178,7 @@
 
38
     -L|--no_locales)   locales=0; shift 2;;
 
39
     -T|--tarball)      tarball=$2; shift 2;;
 
40
     -d|--debug)        debug=1; shift 1;;
 
41
+    -s|--stream)       stream=$2; shift 2;;
 
42
     --)                shift 1; break ;;
 
43
         *)              break ;;
 
44
     esac
 
45
@@ -199,6 +202,11 @@
 
46
     exit 1
 
47
 fi
 
48
 
 
49
+if [ "$stream" != "daily" -a "$stream" != "released" ]; then
 
50
+    echo "Only 'daily' and 'released' streams are supported"
 
51
+    exit 1
 
52
+fi
 
53
+
 
54
 if [ -z "$path" ]; then
 
55
     echo "'path' parameter is required"
 
56
     exit 1
 
57
@@ -223,7 +231,7 @@
 
58
 if [ -n "$tarball" ]; then
 
59
        url2="$tarball"
 
60
 else
 
61
-       url1=`ubuntu-cloudimg-query $release released $arch --format "%{url}\n"`
 
62
+       url1=`ubuntu-cloudimg-query $release $stream $arch --format "%{url}\n"`
 
63
        url2=`echo $url1 | sed -e 's/.tar.gz/-root\0/'`
 
64
 fi
 
65