Merge lp:~thumper/juju-core/maybe-add-cloud-archive-func into lp:~go-bot/juju-core/trunk

Proposed by Tim Penhey
Status: Merged
Approved by: John A Meinel
Approved revision: no longer in the source branch.
Merged at revision: 2391
Proposed branch: lp:~thumper/juju-core/maybe-add-cloud-archive-func
Merge into: lp:~go-bot/juju-core/trunk
Prerequisite: lp:~thumper/juju-core/move-to-juju-loggo
Diff against target: 82 lines (+29/-22)
1 file modified
environs/cloudinit/cloudinit.go (+29/-22)
To merge this branch: bzr merge lp:~thumper/juju-core/maybe-add-cloud-archive-func
Reviewer Review Type Date Requested Status
Juju Engineering Pending
Review via email: mp+209798@code.launchpad.net

Commit message

Make MaybeAddCoudArchiveCloudTools a simple func

Simple change that will be used further down the pipe.
Will be called by the code that makes the lxc template
image, but there will be no machine config object.

https://codereview.appspot.com/72050045/

Description of the change

Make MaybeAddCoudArchiveCloudTools a simple func

Simple change that will be used further down the pipe.
Will be called by the code that makes the lxc template
image, but there will be no machine config object.

https://codereview.appspot.com/72050045/

To post a comment you must log in.
Revision history for this message
Tim Penhey (thumper) wrote :

Reviewers: mp+209798_code.launchpad.net,

Message:
Please take a look.

Description:
Make MaybeAddCoudArchiveCloudTools a simple func

Simple change that will be used further down the pipe.
Will be called by the code that makes the lxc template
image, but there will be no machine config object.

https://code.launchpad.net/~thumper/juju-core/maybe-add-cloud-archive-func/+merge/209798

Requires:
https://code.launchpad.net/~thumper/juju-core/move-to-juju-loggo/+merge/209530

(do not edit description out of merge proposal)

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

Affected files (+5, -3 lines):
   A [revision details]
   M environs/cloudinit/cloudinit.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: <email address hidden>
+New revision: <email address hidden>

Index: environs/cloudinit/cloudinit.go
=== modified file 'environs/cloudinit/cloudinit.go'
--- environs/cloudinit/cloudinit.go 2014-02-27 05:24:43 +0000
+++ environs/cloudinit/cloudinit.go 2014-03-06 21:55:44 +0000
@@ -326,7 +326,8 @@
   // for series that need it. This gives us up-to-date LXC,
   // MongoDB, and other infrastructure.
   if !cfg.DisablePackageCommands {
- cfg.MaybeAddCloudArchiveCloudTools(c)
+ series := cfg.Tools.Version.Series
+ MaybeAddCloudArchiveCloudTools(c, series)
   }

   if cfg.StateServer {
@@ -573,8 +574,7 @@

  // 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
+func MaybeAddCloudArchiveCloudTools(c *cloudinit.Config, series string) {
   if series != "precise" {
    // Currently only precise; presumably we'll
    // need to add each LTS in here as they're

Revision history for this message
Tim Penhey (thumper) wrote :
Revision history for this message
Ian Booth (wallyworld) wrote :
Revision history for this message
Go Bot (go-bot) wrote :
Download full text (10.5 KiB)

The attempt to merge lp:~thumper/juju-core/maybe-add-cloud-archive-func into lp:juju-core failed. Below is the output from the failed tests.

ok launchpad.net/juju-core 0.014s
ok launchpad.net/juju-core/agent 1.050s
ok launchpad.net/juju-core/agent/mongo 0.512s
ok launchpad.net/juju-core/agent/tools 0.199s
ok launchpad.net/juju-core/bzr 5.060s
ok launchpad.net/juju-core/cert 2.940s
ok launchpad.net/juju-core/charm 0.472s
? launchpad.net/juju-core/charm/hooks [no test files]
? launchpad.net/juju-core/charm/testing [no test files]
ok launchpad.net/juju-core/cloudinit 0.029s
ok launchpad.net/juju-core/cloudinit/sshinit 0.743s
ok launchpad.net/juju-core/cmd 0.183s
ok launchpad.net/juju-core/cmd/charm-admin 0.726s
? launchpad.net/juju-core/cmd/charmd [no test files]
? launchpad.net/juju-core/cmd/charmload [no test files]

----------------------------------------------------------------------
FAIL: publish_test.go:75: PublishSuite.SetUpTest

publish_test.go:88:
    c.Assert(err, gc.IsNil)
... value *errors.errorString = &errors.errorString{s:"error running \"bzr init\": bzr: ERROR: Couldn't import bzrlib and dependencies.\nPlease check the directory containing bzrlib is on your PYTHONPATH.\n\nTraceback (most recent call last):\n File \"/home/tarmac/.local/bin/bzr\", line 74, in <module>\n import bzrlib\nImportError: No module named bzrlib\nexit status 1"} ("error running \"bzr init\": bzr: ERROR: Couldn't import bzrlib and dependencies.\nPlease check the directory containing bzrlib is on your PYTHONPATH.\n\nTraceback (most recent call last):\n File \"/home/tarmac/.local/bin/bzr\", line 74, in <module>\n import bzrlib\nImportError: No module named bzrlib\nexit status 1")

----------------------------------------------------------------------
PANIC: publish_test.go:159: PublishSuite.TestBrokenCharm

... Panic: Fixture has panicked (see related PANIC)
OOPS: 182 passed, 2 skipped, 1 FAILED, 17 MISSED
--- FAIL: TestPackage (171.45 seconds)
FAIL
FAIL launchpad.net/juju-core/cmd/juju 171.619s
ok launchpad.net/juju-core/cmd/jujud 64.545s
ok launchpad.net/juju-core/cmd/plugins/juju-metadata 8.274s
? launchpad.net/juju-core/cmd/plugins/juju-restore [no test files]
ok launchpad.net/juju-core/cmd/plugins/local 0.158s
? launchpad.net/juju-core/cmd/plugins/local/juju-local [no test files]
ok launchpad.net/juju-core/constraints 0.024s
ok launchpad.net/juju-core/container 0.031s
ok launchpad.net/juju-core/container/factory 0.041s
ok launchpad.net/juju-core/container/kvm 0.198s
ok launchpad.net/juju-core/container/kvm/mock 0.038s
? launchpad.net/juju-core/container/kvm/testing [no test files]
ok launchpad.net/juju-core/container/lxc 0.219s
? launchpad.net/juju-core/container/lxc/mock [no test files]
? launchpad.net/juju-core/container/lxc/testing [no test files]
? launchpad.net/juju-core/container/testing [no test files]
ok launchpad.net/juju-core/downloader 5.259s
ok launchpad.net/juju-core/environs 2.510s
ok launchpad.net/juju-core/environs/bootstrap 3.097s
ok launchpad.net/juju-core/environs/cloudinit 0.424s
ok launchpad.net/juju-core/environs/config 3.887s
ok launchpad.ne...

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 2014-02-27 05:24:43 +0000
3+++ environs/cloudinit/cloudinit.go 2014-03-06 23:22:52 +0000
4@@ -206,6 +206,31 @@
5 return nil
6 }
7
8+// AddAptCommands update the cloudinit.Config instance with the necessary
9+// packages, the request to do the apt-get update/upgrade on boot, and adds
10+// the apt proxy settings if there are any.
11+func AddAptCommands(proxy osenv.ProxySettings, c *cloudinit.Config) {
12+ // Bring packages up-to-date.
13+ c.SetAptUpdate(true)
14+ c.SetAptUpgrade(true)
15+
16+ // juju requires git for managing charm directories.
17+ c.AddPackage("git")
18+ c.AddPackage("cpu-checker")
19+ c.AddPackage("bridge-utils")
20+ c.AddPackage("rsyslog-gnutls")
21+
22+ // Write out the apt proxy settings
23+ if (proxy != osenv.ProxySettings{}) {
24+ filename := utils.AptConfFile
25+ c.AddBootCmd(fmt.Sprintf(
26+ `[ -f %s ] || (printf '%%s\n' %s > %s)`,
27+ filename,
28+ shquote(utils.AptProxyContent(proxy)),
29+ filename))
30+ }
31+}
32+
33 // ConfigureJuju updates the provided cloudinit.Config with configuration
34 // to initialise a Juju machine agent.
35 func ConfigureJuju(cfg *MachineConfig, c *cloudinit.Config) error {
36@@ -230,25 +255,7 @@
37 }
38
39 if !cfg.DisablePackageCommands {
40- // Bring packages up-to-date.
41- c.SetAptUpdate(true)
42- c.SetAptUpgrade(true)
43-
44- // juju requires git for managing charm directories.
45- c.AddPackage("git")
46- c.AddPackage("cpu-checker")
47- c.AddPackage("bridge-utils")
48- c.AddPackage("rsyslog-gnutls")
49-
50- // Write out the apt proxy settings
51- if (cfg.AptProxySettings != osenv.ProxySettings{}) {
52- filename := utils.AptConfFile
53- c.AddBootCmd(fmt.Sprintf(
54- `[ -f %s ] || (printf '%%s\n' %s > %s)`,
55- filename,
56- shquote(utils.AptProxyContent(cfg.AptProxySettings)),
57- filename))
58- }
59+ AddAptCommands(cfg.AptProxySettings, c)
60 }
61
62 // Write out the normal proxy settings so that the settings are
63@@ -326,7 +333,8 @@
64 // for series that need it. This gives us up-to-date LXC,
65 // MongoDB, and other infrastructure.
66 if !cfg.DisablePackageCommands {
67- cfg.MaybeAddCloudArchiveCloudTools(c)
68+ series := cfg.Tools.Version.Series
69+ MaybeAddCloudArchiveCloudTools(c, series)
70 }
71
72 if cfg.StateServer {
73@@ -573,8 +581,7 @@
74
75 // MaybeAddCloudArchiveCloudTools adds the cloud-archive cloud-tools
76 // pocket to apt sources, if the series requires it.
77-func (cfg *MachineConfig) MaybeAddCloudArchiveCloudTools(c *cloudinit.Config) {
78- series := cfg.Tools.Version.Series
79+func MaybeAddCloudArchiveCloudTools(c *cloudinit.Config, series string) {
80 if series != "precise" {
81 // Currently only precise; presumably we'll
82 // need to add each LTS in here as they're

Subscribers

People subscribed via source and target branches

to status/vote changes: