Merge lp:~axwalk/juju-core/lp1313960-bootstrap-to into lp:~go-bot/juju-core/trunk
Proposed by
Andrew Wilkins
Status: | Merged |
---|---|
Approved by: | Andrew Wilkins |
Approved revision: | no longer in the source branch. |
Merged at revision: | 2687 |
Proposed branch: | lp:~axwalk/juju-core/lp1313960-bootstrap-to |
Merge into: | lp:~go-bot/juju-core/trunk |
Diff against target: |
69 lines (+13/-19) 2 files modified
cmd/juju/bootstrap.go (+9/-15) cmd/juju/bootstrap_test.go (+4/-4) |
To merge this branch: | bzr merge lp:~axwalk/juju-core/lp1313960-bootstrap-to |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju Engineering | Pending | ||
Review via email: mp+217837@code.launchpad.net |
Commit message
cmd/juju: bootstrap --to <placement>
Change bootstrap to use "--to <placement>",
to make way for repurposing positional args.
Fixes lp:1313960
Description of the change
cmd/juju: bootstrap --to <placement>
Change bootstrap to use "--to <placement>",
to make way for repurposing positional args.
Fixes lp:1313960
To post a comment you must log in.
Reviewers: mp+217837_ code.launchpad. net,
Message:
Please take a look.
Description:
cmd/juju: bootstrap --to <placement>
Change bootstrap to use "--to <placement>",
to make way for repurposing positional args.
Fixes lp:1313960
https:/ /code.launchpad .net/~axwalk/ juju-core/ lp1313960- bootstrap- to/+merge/ 217837
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/90970043/
Affected files (+15, -19 lines): bootstrap. go bootstrap_ test.go
A [revision details]
M cmd/juju/
M cmd/juju/
Index: [revision details] 20140430030329- cl8i2buuaypidtg 4
=== 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 2014-04-24 12:33:19 +0000 bootstrap. go 2014-04-30 22:05:31 +0000 &c.UploadTools, "upload-tools", false, "upload local version of seriesVar{ &c.Series} , "series", "upload tools for supplied &c.MetadataSour ce, "metadata-source", "", "local path to use &c.Placement, "to", "", "a placement directive indicating an
=== modified file 'cmd/juju/
--- cmd/juju/
+++ cmd/juju/
@@ -72,7 +72,6 @@
func (c *BootstrapCommand) Info() *cmd.Info {
return &cmd.Info{
Name: "bootstrap",
- Args: "[placement]",
Purpose: "start up an environment from scratch",
Doc: bootstrapDoc,
}
@@ -84,6 +83,7 @@
f.BoolVar(
tools before bootstrapping")
f.Var(
comma-separated series list")
f.StringVar(
as tools and/or metadata source")
+ f.StringVar(
instance to bootstrap")
}
func (c *BootstrapCommand) Init(args []string) (err error) { gs(args) ParsePlacement( placement) ErrPlacementSco peMissing { "unsupported bootstrap placement directive %q", ParsePlacement( c.Placement) ErrPlacementSco peMissing { "unsupported bootstrap placement directive %q", args)
@@ -96,20 +96,14 @@
}
// Parse the placement directive. Bootstrap currently only
// supports provider-specific placement directives.
- placement, err := cmd.ZeroOrOneAr
- if err != nil {
- return err
- }
- if placement == "" {
- return nil
- }
- _, err = instance.
- if err != instance.
- // We only support unscoped placement directives for bootstrap.
- return fmt.Errorf(
placement)
- }
- c.Placement = placement
- return nil
+ if c.Placement != "" {
+ _, err = instance.
+ if err != instance.
+ // We only support unscoped placement directives for bootstrap.
+ return fmt.Errorf(
c.Placement)
+ }
+ }
+ return cmd.CheckEmpty(
}
// Run connects to the environment specified on the command line and
bootstraps
Index: cmd/juju/ bootstrap_ test.go bootstrap_ test.go' bootstrap_ test.go 2014-04-25 04:23:08 +0000 bootstrap_ test.go 2014-04-30 22:05:31 +0000 "something" }, "ssh:someplace" },
=== modified file 'cmd/juju/
--- cmd/juju/
+++ cmd/juju/
@@ -376,12 +376,12 @@
},
}, {
info: "placement",
- args: []string{
+ args: []string{"--to", "something"},
placement: "something",
}, {
- info: "invalid placement: ssh",
- args: []string{
- err: `unsupported bootstrap placement dire...