Code review comment for lp:~axwalk/juju-core/spurious-bootstrap-error-message

Revision history for this message
Andrew Wilkins (axwalk) wrote :

Reviewers: mp+212764_code.launchpad.net,

Message:
Please take a look.

Description:
cmd/juju: fix spurious "bootstrap failed" message

https://code.launchpad.net/~axwalk/juju-core/spurious-bootstrap-error-message/+merge/212764

(do not edit description out of merge proposal)

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

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

Index: cmd/juju/common.go
=== modified file 'cmd/juju/common.go'
--- cmd/juju/common.go 2014-03-26 03:30:35 +0000
+++ cmd/juju/common.go 2014-03-26 04:36:17 +0000
@@ -11,10 +11,11 @@
  )

  // destroyPreparedEnviron destroys the environment and logs an error if it
fails.
-func destroyPreparedEnviron(env environs.Environ, store
configstore.Storage, err *error, action string) {
+func destroyPreparedEnviron(ctx *cmd.Context, env environs.Environ, store
configstore.Storage, err *error, action string) {
   if *err == nil {
    return
   }
+ ctx.Infof("%s failed, destroying environment", action)
   if err := environs.Destroy(env, store); err != nil {
    logger.Errorf("%s failed, and the environment could not be
destroyed: %v", action, err)
   }
@@ -39,8 +40,7 @@
   }
   cleanup := func() {
    if !existing {
- ctx.Infof("%s failed, destroying environment", action)
- destroyPreparedEnviron(environ, store, resultErr, action)
+ destroyPreparedEnviron(ctx, environ, store, resultErr, action)
    }
   }
   return environ, cleanup, nil

« Back to merge proposal