Merge lp:~axwalk/juju-core/reinstate-cmd-juju-bootstrap-source into lp:~go-bot/juju-core/trunk
Status: | Merged |
---|---|
Approved by: | Andrew Wilkins |
Approved revision: | no longer in the source branch. |
Merged at revision: | 2091 |
Proposed branch: | lp:~axwalk/juju-core/reinstate-cmd-juju-bootstrap-source |
Merge into: | lp:~go-bot/juju-core/trunk |
Diff against target: |
77 lines (+41/-1) 2 files modified
cmd/juju/bootstrap.go (+7/-1) cmd/juju/bootstrap_test.go (+34/-0) |
To merge this branch: | bzr merge lp:~axwalk/juju-core/reinstate-cmd-juju-bootstrap-source |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju Engineering | Pending | ||
Review via email: mp+196040@code.launchpad.net |
Commit message
cmd/juju: reinstate --source for juju bootstrap
In r2069 I removed the --source option of juju bootstrap.
It has since come to light that this remains a desirable
option for MAAS users, and that we should go through a
two-step deprecation anyway.
I've reinstated the option, but changed the way it's
implemented: it now simply overrides the value of
environs/
Description of the change
cmd/juju: reinstate --source for juju bootstrap
In r2069 I removed the --source option of juju bootstrap.
It has since come to light that this remains a desirable
option for MAAS users, and that we should go through a
two-step deprecation anyway.
I've reinstated the option, but changed the way it's
implemented: it now simply overrides the value of
environs/
Reviewers: mp+196040_ code.launchpad. net,
Message:
Please take a look.
Description:
cmd/juju: reinstate --source for juju bootstrap
In r2069 I removed the --source option of juju bootstrap.
It has since come to light that this remains a desirable
option for MAAS users, and that we should go through a
two-step deprecation anyway.
I've reinstated the option, but changed the way it's sync.DefaultToo lsLocation.
implemented: it now simply overrides the value of
environs/
https:/ /code.launchpad .net/~axwalk/ juju-core/ reinstate- cmd-juju- bootstrap- source/ +merge/ 196040
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/29990044/
Affected files (+48, -1 lines): bootstrap. go bootstrap_ test.go
A [revision details]
M cmd/juju/
M cmd/juju/
Index: [revision details] 20131120142833- kh97nkpng5qaps4 o
=== 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: cmd/juju/ bootstrap. go bootstrap. go' bootstrap. go 2013-11-18 05:41:36 +0000 bootstrap. go 2013-11-21 01:18:17 +0000
=== modified file 'cmd/juju/
--- cmd/juju/
+++ cmd/juju/
@@ -52,6 +52,7 @@
Constraints constraints.Value
UploadTools bool
Series []string
+ Source string
}
func (c *BootstrapCommand) Info() *cmd.Info { constraints. ConstraintsValu e{&c.Constraint s}, "constraints", "set &c.UploadTools, "upload-tools", false, "upload local version of seriesVar{ &c.Series} , "series", "upload tools for supplied &c.Source, "source", "", "local path to use as tools source")
@@ -67,6 +68,7 @@
f.Var(
environment constraints")
f.BoolVar(
tools before bootstrapping")
f.Var(
comma-separated series list")
+ f.StringVar(
}
func (c *BootstrapCommand) Init(args []string) error { EnsureNotBootst rapped( environ) ; err != nil { Infof(" Setting default tools source: %s", c.Source) lsLocation = c.Source
@@ -98,7 +100,11 @@
if err := bootstrap.
return err
}
-
+ // If --source is specified, override the default tools source.
+ if c.Source != "" {
+ logger.
+ sync.DefaultToo
+ }
// TODO (wallyworld): 2013-09-20 bug 1227931
// We can set a custom tools data source instead of doing an
// unecessary upload.
Index: cmd/juju/ bootstrap_ test.go bootstrap_ test.go' bootstrap_ test.go 2013-11-18 06:27:04 +0000 bootstrap_ test.go 2013-11-21 01:18:17 +0000 coretesting. Stdout( ctx2), gc.Equals, "")
=== modified file 'cmd/juju/
--- cmd/juju/
+++ cmd/juju/
@@ -313,6 +313,45 @@
c.Check(
}
+func (s *BootstrapSuite) TestAutoSyncLoc alSource( c *gc.C) { ce(c, vAll) Current. Number = version. MustParse( "1.2.0" ) me(c)
+ // Prepare a tools directory for testing and store the
+ // dummy tools in there.
+ sourceDir := createToolsSour
+
+ // Change the version and ensure its later restoring.
+ origVersion := version.Current
+ version.
+ defer func() {
+ version.Current = origVersion
+ }()
+
+ // Create home with dummy provider and remove all
+ // of its envtools.
+ env, fake := makeEmptyFakeHo
+ defer fake.Restore()
+
+ // Bootstrap the environment with an i...