Merge lp:~axwalk/juju-core/lp1234127-add-cloud-tools-pocket into lp:~go-bot/juju-core/trunk

Proposed by Andrew Wilkins
Status: Merged
Approved by: Dimiter Naydenov
Approved revision: no longer in the source branch.
Merged at revision: 1948
Proposed branch: lp:~axwalk/juju-core/lp1234127-add-cloud-tools-pocket
Merge into: lp:~go-bot/juju-core/trunk
Diff against target: 96 lines (+35/-6)
2 files modified
environs/cloudinit/cloudinit.go (+26/-2)
environs/cloudinit/cloudinit_test.go (+9/-4)
To merge this branch: bzr merge lp:~axwalk/juju-core/lp1234127-add-cloud-tools-pocket
Reviewer Review Type Date Requested Status
Dimiter Naydenov (community) Approve
Review via email: mp+189023@code.launchpad.net

Commit message

environs/cloudinit: use cloud-tools on precise

Use the cloud-tools pocket of the cloud archive on
12.04 (presumably we'll update for later LTS'). Also,
remove the PPA for precise, as cloud-tools has a recent
enough version of mongodb-server for our needs.

I've added cloud-tools to apt not just for state
servers, but so it's picked up by all; thus we'll get
up-to-date LXC for when we support containers on
non-local providers.

The OpenStack pockets are not added, as there are
separate ones for separate releases. It'll have to
be up to the charms to add that, I think.

Fixes #1234127

https://codereview.appspot.com/14329043/

Description of the change

environs/cloudinit: use cloud-tools on precise

Use the cloud-tools pocket of the cloud archive on
12.04 (presumably we'll update for later LTS'). Also,
remove the PPA for precise, as cloud-tools has a recent
enough version of mongodb-server for our needs.

I've added cloud-tools to apt not just for state
servers, but so it's picked up by all; thus we'll get
up-to-date LXC for when we support containers on
non-local providers.

The OpenStack pockets are not added, as there are
separate ones for separate releases. It'll have to
be up to the charms to add that, I think.

Fixes #1234127

https://codereview.appspot.com/14329043/

To post a comment you must log in.
Revision history for this message
Andrew Wilkins (axwalk) wrote :
Download full text (4.9 KiB)

Reviewers: mp+189023_code.launchpad.net,

Message:
Please take a look.

Description:
environs/cloudinit: use cloud-tools on precise

Use the cloud-tools pocket of the cloud archive on
12.04 (presumably we'll update for later LTS'). Also,
remove the PPA for precise, as cloud-tools has a recent
enough version of mongodb-server for our needs.

I've added cloud-tools to apt not just for state
servers, but so it's picked up by all; thus we'll get
up-to-date LXC for when we support containers on
non-local providers.

The OpenStack pockets are not added, as there are
separate ones for separate releases. It'll have to
be up to the charms to add that, I think.

Fixes #1234127

https://code.launchpad.net/~axwalk/juju-core/lp1234127-add-cloud-tools-pocket/+merge/189023

(do not edit description out of merge proposal)

Please review this at https://codereview.appspot.com/14329043/

Affected files (+37, -6 lines):
   A [revision details]
   M environs/cloudinit/cloudinit.go
   M environs/cloudinit/cloudinit_test.go

Index: [revision details]
=== added file '[revision details]'
--- [revision details] 2012-01-01 00:00:00 +0000
+++ [revision details] 2012-01-01 00:00:00 +0000
@@ -0,0 +1,2 @@
+Old revision: tarmac-20131003034818-qhcpzxqc7ianxg2n
+New revision: <email address hidden>

Index: environs/cloudinit/cloudinit.go
=== modified file 'environs/cloudinit/cloudinit.go'
--- environs/cloudinit/cloudinit.go 2013-10-02 09:52:01 +0000
+++ environs/cloudinit/cloudinit.go 2013-10-03 09:45:30 +0000
@@ -191,12 +191,18 @@
    return nil, err
   }

+ // Add the cloud archive cloud-tools pocket to apt sources
+ // for series that need it. This gives us up-to-date LXC,
+ // MongoDB, and other infrastructure.
+ cfg.MaybeAddCloudArchiveCloudTools(c)
+
   if cfg.StateServer {
    // disable the default mongodb installed by the mongodb-server package.
    c.AddBootCmd(`echo ENABLE_MONGODB="no" > /etc/default/mongodb`)

    if cfg.NeedMongoPPA() {
- c.AddAptSource("ppa:juju/stable", "1024R/C8068B11")
+ const key = "" // key is loaded from PPA
+ c.AddAptSource("ppa:juju/stable", key)
    }
    c.AddPackage("mongodb-server")
    certKey := string(cfg.StateServerCert) + string(cfg.StateServerKey)
@@ -377,11 +383,29 @@
   return hosts
  }

+// MaybeAddCloudArchiveCloudTools adds the cloud-archive cloud-tools
+// pocket to apt sources, if the series requires it.
+func (cfg *MachineConfig) MaybeAddCloudArchiveCloudTools(c
*cloudinit.Config) {
+ series := cfg.Tools.Version.Series
+ if series != "precise" {
+ // Currently only precise; presumably we'll
+ // need to add each LTS in here as they're
+ // added to the cloud archive.
+ return
+ }
+ const url = "http://ubuntu-cloud.archive.canonical.com/ubuntu"
+ const keyid = "EC4926EA"
+ const keyserver = "" // use default
+ name := fmt.Sprintf("deb %s %s-updates/cloud-tools main", url, series)
+ c.AddAptSourceWithKeyId(name, keyid, keyserver)
+}
+
  func (cfg *MachineConfig) NeedMongoPPA() bool {
   series := cfg.Tools.Version.Series
   // 11.10 and earlier are not supported.
+ // 12.04 can get a compatible version from the cloud-archive.
   // 13.04 and later ship a compatible vers...

Read more...

Revision history for this message
Dimiter Naydenov (dimitern) wrote :

Since axw is away at this time, and we need this fix for 1.15.1, I'll
LGTM it and land it now.

https://codereview.appspot.com/14329043/

Revision history for this message
Dimiter Naydenov (dimitern) :
review: Approve
Revision history for this message
Go Bot (go-bot) wrote :
Download full text (16.2 KiB)

The attempt to merge lp:~axwalk/juju-core/lp1234127-add-cloud-tools-pocket into lp:juju-core failed. Below is the output from the failed tests.

ok launchpad.net/juju-core/agent 0.306s
ok launchpad.net/juju-core/agent/tools 0.268s
ok launchpad.net/juju-core/bzr 7.343s
ok launchpad.net/juju-core/cert 2.652s
ok launchpad.net/juju-core/charm 0.564s
? launchpad.net/juju-core/charm/hooks [no test files]
ok launchpad.net/juju-core/cloudinit 0.026s
ok launchpad.net/juju-core/cmd 0.220s
? launchpad.net/juju-core/cmd/charmd [no test files]
? launchpad.net/juju-core/cmd/charmload [no test files]
ok launchpad.net/juju-core/cmd/juju 176.246s
ok launchpad.net/juju-core/cmd/jujud 47.294s
ok launchpad.net/juju-core/cmd/plugins/juju-metadata 1.709s
ok launchpad.net/juju-core/constraints 0.028s
ok launchpad.net/juju-core/container/lxc 0.315s
? launchpad.net/juju-core/container/lxc/mock [no test files]
ok launchpad.net/juju-core/downloader 5.262s
ok launchpad.net/juju-core/environs 2.925s
ok launchpad.net/juju-core/environs/bootstrap 4.957s
ok launchpad.net/juju-core/environs/cloudinit 0.452s
ok launchpad.net/juju-core/environs/config 0.702s
ok launchpad.net/juju-core/environs/configstore 0.040s
ok launchpad.net/juju-core/environs/filestorage 0.033s
ok launchpad.net/juju-core/environs/httpstorage 0.886s
ok launchpad.net/juju-core/environs/imagemetadata 0.454s
ok launchpad.net/juju-core/environs/instances 0.051s
ok launchpad.net/juju-core/environs/jujutest 0.240s
ok launchpad.net/juju-core/environs/manual 4.104s
ok launchpad.net/juju-core/environs/simplestreams 0.347s
? launchpad.net/juju-core/environs/simplestreams/testing [no test files]
ok launchpad.net/juju-core/environs/sshstorage 1.128s
ok launchpad.net/juju-core/environs/storage 1.372s
ok launchpad.net/juju-core/environs/sync 29.266s
ok launchpad.net/juju-core/environs/testing 0.197s
ok launchpad.net/juju-core/environs/tools 6.833s
? launchpad.net/juju-core/environs/tools/testing [no test files]
ok launchpad.net/juju-core/errors 0.016s
ok launchpad.net/juju-core/instance 0.023s
? launchpad.net/juju-core/instance/testing [no test files]
ok launchpad.net/juju-core/juju 17.047s
ok launchpad.net/juju-core/juju/osenv 0.019s
? launchpad.net/juju-core/juju/testing [no test files]
ok launchpad.net/juju-core/log 0.016s
ok launchpad.net/juju-core/log/syslog 0.022s
ok launchpad.net/juju-core/names 0.022s
? launchpad.net/juju-core/provider [no test files]
? launchpad.net/juju-core/provider/all [no test files]
ok launchpad.net/juju-core/provider/azure 6.721s
ok launchpad.net/juju-core/provider/common 0.279s
ok launchpad.net/juju-core/provider/dummy 21.352s
ok launchpad.net/juju-core/provider/ec2 5.358s
ok launchpad.net/juju-core/provider/ec2/httpstorage 0.185s
ok launchpad.net/juju-core/provider/local 2.255s
ok launchpad.net/juju-core/provider/maas 3.701s
ok launchpad.net/juju-core/provider/null 1.152s
ok launchpad.net/juju-core/provider/openstack 13.454s
ok launchpad.net/juju-core/rpc 0.079s
ok launchpad.net/juju-core/rpc/jsoncodec 0.029s
? launchpad.net/juju-core/rpc/rpcreflect [no test f...

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'environs/cloudinit/cloudinit.go'
2--- environs/cloudinit/cloudinit.go 2013-10-02 09:52:01 +0000
3+++ environs/cloudinit/cloudinit.go 2013-10-03 09:53:25 +0000
4@@ -191,12 +191,18 @@
5 return nil, err
6 }
7
8+ // Add the cloud archive cloud-tools pocket to apt sources
9+ // for series that need it. This gives us up-to-date LXC,
10+ // MongoDB, and other infrastructure.
11+ cfg.MaybeAddCloudArchiveCloudTools(c)
12+
13 if cfg.StateServer {
14 // disable the default mongodb installed by the mongodb-server package.
15 c.AddBootCmd(`echo ENABLE_MONGODB="no" > /etc/default/mongodb`)
16
17 if cfg.NeedMongoPPA() {
18- c.AddAptSource("ppa:juju/stable", "1024R/C8068B11")
19+ const key = "" // key is loaded from PPA
20+ c.AddAptSource("ppa:juju/stable", key)
21 }
22 c.AddPackage("mongodb-server")
23 certKey := string(cfg.StateServerCert) + string(cfg.StateServerKey)
24@@ -377,11 +383,29 @@
25 return hosts
26 }
27
28+// MaybeAddCloudArchiveCloudTools adds the cloud-archive cloud-tools
29+// pocket to apt sources, if the series requires it.
30+func (cfg *MachineConfig) MaybeAddCloudArchiveCloudTools(c *cloudinit.Config) {
31+ series := cfg.Tools.Version.Series
32+ if series != "precise" {
33+ // Currently only precise; presumably we'll
34+ // need to add each LTS in here as they're
35+ // added to the cloud archive.
36+ return
37+ }
38+ const url = "http://ubuntu-cloud.archive.canonical.com/ubuntu"
39+ const keyid = "EC4926EA"
40+ const keyserver = "" // use default
41+ name := fmt.Sprintf("deb %s %s-updates/cloud-tools main", url, series)
42+ c.AddAptSourceWithKeyId(name, keyid, keyserver)
43+}
44+
45 func (cfg *MachineConfig) NeedMongoPPA() bool {
46 series := cfg.Tools.Version.Series
47 // 11.10 and earlier are not supported.
48+ // 12.04 can get a compatible version from the cloud-archive.
49 // 13.04 and later ship a compatible version in the archive.
50- return series == "precise" || series == "quantal"
51+ return series == "quantal"
52 }
53
54 func shquote(p string) string {
55
56=== modified file 'environs/cloudinit/cloudinit_test.go'
57--- environs/cloudinit/cloudinit_test.go 2013-10-02 09:52:01 +0000
58+++ environs/cloudinit/cloudinit_test.go 2013-10-03 09:53:25 +0000
59@@ -448,12 +448,17 @@
60 checkPackage(c, x, "lxc", hasLxc)
61 if test.cfg.StateServer {
62 checkPackage(c, x, "mongodb-server", true)
63- source := struct{ source, key string }{
64+ source := struct{ source, keyid string }{
65 source: "ppa:juju/stable",
66- key: "1024R/C8068B11",
67 }
68 checkAptSource(c, x, source, test.cfg.NeedMongoPPA())
69 }
70+ source := struct{ source, keyid string }{
71+ source: "deb http://ubuntu-cloud.archive.canonical.com/ubuntu precise-updates/cloud-tools main",
72+ keyid: "EC4926EA",
73+ }
74+ needCloudArchive := test.cfg.Tools.Version.Series == "precise"
75+ checkAptSource(c, x, source, needCloudArchive)
76 }
77 }
78
79@@ -551,7 +556,7 @@
80
81 // CheckAptSources checks that the cloudinit will or won't install the given
82 // source, depending on the value of match.
83-func checkAptSource(c *gc.C, x map[interface{}]interface{}, source struct{ source, key string }, match bool) {
84+func checkAptSource(c *gc.C, x map[interface{}]interface{}, source struct{ source, keyid string }, match bool) {
85 sources0 := x["apt_sources"]
86 if sources0 == nil {
87 if match {
88@@ -565,7 +570,7 @@
89 found := false
90 for _, s0 := range sources {
91 s := s0.(map[interface{}]interface{})
92- if s["source"] == source.source && s["key"] == source.key {
93+ if s["source"] == source.source && (source.keyid == "" || s["keyid"] == source.keyid) {
94 found = true
95 }
96 }

Subscribers

People subscribed via source and target branches

to status/vote changes: