Merge lp://staging/~dimitern/juju-core/fix-maas-pvd-conf into lp://staging/~juju/juju-core/trunk
Status: | Merged |
---|---|
Merged at revision: | 1156 |
Proposed branch: | lp://staging/~dimitern/juju-core/fix-maas-pvd-conf |
Merge into: | lp://staging/~juju/juju-core/trunk |
Diff against target: |
45 lines (+26/-1) 2 files modified
environs/maas/environprovider.go (+5/-1) environs/maas/environprovider_test.go (+21/-0) |
To merge this branch: | bzr merge lp://staging/~dimitern/juju-core/fix-maas-pvd-conf |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju Engineering | Pending | ||
Review via email: mp+158961@code.staging.launchpad.net |
Description of the change
environs/maas: fix provider config
[Note: this was originally proposed as lp:~rvb/juju-core/fix-maas-pvd-conf in the following MP:
https:/
Due to issues with lbox, rvba asked me to submit this for him. No changes made, except
merging latest trunk.]
This branch fixes a problem we saw happening in the MAAS lab while testing the MAAS provider. The symptom was that, after having installed the bootstrap node ok, Juju was unable to deploy any service. The error found in the bootstrap node's logs: http://
The problem is that, from this code in cmd/jujud/
Reviewers: mp+158961_ code.launchpad. net,
Message:
Please take a look.
Description:
environs/maas: fix provider config
[Note: this was originally proposed as /code.launchpad .net/~rvb/ juju-core/ fix-maas- pvd-conf/ +merge/ 158938
lp:~rvb/juju-core/fix-maas-pvd-conf in the following MP:
https:/
Due to issues with lbox, rvba asked me to submit this for him. No
changes made, except
merging latest trunk.]
This branch fixes a problem we saw happening in the MAAS lab while paste.ubuntu. com/5709878/.
testing the MAAS provider. The symptom was that, after having installed
the bootstrap node ok, Juju was unable to deploy any service. The error
found in the bootstrap node's logs: http://
The problem is that, from this code in cmd/jujud/ upgrade. go: paste.ubuntu. com/5710182/, environs/ maas/environ. go:SetConfig maas/environpro vider.go: Open(), when the config is golang. org/doc/ faq#nil_ error) and thus, in cmd/jujud/ upgrade. go SetConfig( cfg)' gets called on a nil
http://
ends up being called on a nil object. After investigating the problem, I
found that environs/
invalid, returns a interface that has a nil value but a non-nil type
(http://
(see snippet above), 'environ.
'environ'.
https:/ /code.launchpad .net/~dimitern/ juju-core/ fix-maas- pvd-conf/ +merge/ 158961
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/8772043/
Affected files: maas/environpro vider.go maas/environpro vider_test. go
A [revision details]
M environs/
M environs/
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/ maas/environpro vider.go maas/environpro vider.go' maas/environpro vider.go 2013-04-12 09:45:01 +0000 maas/environpro vider.go 2013-04-15 11:20:15 +0000
=== modified file 'environs/
--- environs/
+++ environs/
@@ -19,7 +19,11 @@
func (maasEnvironPro vider) Open(cfg *config.Config) (environs.Environ, Debugf( "environs/ maas: opening environment %q.", cfg.Name())
error) {
log.
- return NewEnviron(cfg)
+ env, err := NewEnviron(cfg)
+ if err != nil {
+ return nil, err
+ }
+ return env, nil
}
// Boilerplate config YAML. Don't mess with the indentation or add
newlines!
Index: environs/ maas/environpro vider_test. go maas/environpro vider_test. go' maas/environpro vider_test. go 2013-04-11 10:33:21 +0000 maas/environpro vider_test. go 2013-04-15 12:22:14 +0000 privateAddress, Equals, hostname) rSuite) NilInterfaceUpo nFailure( c *C) { SetJujuHome( config. SetJujuHome( testJujuHome) ) formatted- oauth-string" interface{ }{ maas.example. com/maas/",
=== modified file 'environs/
--- environs/
+++ environs/
@@ -92,3 +92,24 @@
c.Assert(err, IsNil)
c.Check(
}
+
+func (suite *EnvironProvide
TestOpenReturns
+ testJujuHome := c.MkDir()
+ defer config.
+ const oauth = "wrongly-
+ attrs := map[string]
+ "maas-oauth": oauth,
+ "maas-server": "http://
+ "name": "wheee",
+ "type": "maas",
+ "authorized-keys": "I-am-not-a-real...