Merge lp:~jameinel/juju-core/1.18-panic-parsing-jenv-1312136 into lp:juju-core/1.18
Proposed by
John A Meinel
Status: | Merged |
---|---|
Merged at revision: | 2275 |
Proposed branch: | lp:~jameinel/juju-core/1.18-panic-parsing-jenv-1312136 |
Merge into: | lp:juju-core/1.18 |
Diff against target: |
61 lines (+27/-1) 3 files modified
juju/api.go (+6/-1) juju/apiconn_test.go (+20/-0) juju/export_test.go (+1/-0) |
To merge this branch: | bzr merge lp:~jameinel/juju-core/1.18-panic-parsing-jenv-1312136 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju Engineering | Pending | ||
Review via email: mp+217036@code.launchpad.net |
Description of the change
juju/api.go: actually handle error (bug #1312136)
If there is a problem reading the .jenv file, it can return an error,
but we weren't paying attention to it. Instead we would end up getting a
panic() a few lines down when we go to use a *Config that is actually
nil.
This may not be perfect (because I wasn't seeing errors as I would
expect), but it is better than what we have.
To post a comment you must log in.
Reviewers: mp+217036_ code.launchpad. net,
Message:
Please take a look.
Description:
juju/api.go: actually handle error (bug #1312136)
If there is a problem reading the .jenv file, it can return an error,
but we weren't paying attention to it. Instead we would end up getting a
panic() a few lines down when we go to use a *Config that is actually
nil.
This may not be perfect (because I wasn't seeing errors as I would
expect), but it is better than what we have.
https:/ /code.launchpad .net/~jameinel/ juju-core/ 1.18-panic- parsing- jenv-1312136/ +merge/ 217036
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/92750043/
Affected files (+6, -0 lines):
A [revision details]
M juju/api.go
Index: [revision details] 20140412095413- 8rps4bhva01cu0o 9
=== 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-
+New revision: <email address hidden>
Index: juju/api.go BootstrapConfig ()) > 0 { New(config. NoDefaults, info.BootstrapC onfig() ) Debugf( "failed to parse BootstrapConfig(): %v", err) envName) IsNotFoundError (err) {
=== modified file 'juju/api.go'
--- juju/api.go 2014-03-19 03:18:41 +0000
+++ juju/api.go 2014-04-24 12:13:52 +0000
@@ -259,6 +259,10 @@
var err error
if info != nil && len(info.
cfg, err = config.
+ if err != nil {
+ logger.
+ return apiState{}, err
+ }
} else if envs != nil {
cfg, err = envs.Config(
if errors.