Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(292)

Side by Side Diff: cmd/juju/bootstrap.go

Issue 6145043: cmd/juju: add --upload-tools flag to bootstrap command
Patch Set: cmd/juju: add --upload-tools flag to bootstrap command Created 12 years, 10 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « [revision details] ('k') | cmd/juju/cmd_test.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 package main 1 package main
2 2
3 import ( 3 import (
4 "launchpad.net/gnuflag" 4 "launchpad.net/gnuflag"
5 "launchpad.net/juju/go/cmd" 5 "launchpad.net/juju/go/cmd"
6 "launchpad.net/juju/go/juju" 6 "launchpad.net/juju/go/juju"
7 ) 7 )
8 8
9 // BootstrapCommand is responsible for launching the first machine in a juju 9 // BootstrapCommand is responsible for launching the first machine in a juju
10 // environment, and setting up everything necessary to continue working. 10 // environment, and setting up everything necessary to continue working.
11 type BootstrapCommand struct { 11 type BootstrapCommand struct {
12 » EnvName string 12 » EnvName string
13 » UploadTools bool
13 } 14 }
14 15
15 func (c *BootstrapCommand) Info() *cmd.Info { 16 func (c *BootstrapCommand) Info() *cmd.Info {
16 return &cmd.Info{"bootstrap", "", "start up an environment from scratch" , ""} 17 return &cmd.Info{"bootstrap", "", "start up an environment from scratch" , ""}
17 } 18 }
18 19
19 func (c *BootstrapCommand) Init(f *gnuflag.FlagSet, args []string) error { 20 func (c *BootstrapCommand) Init(f *gnuflag.FlagSet, args []string) error {
20 addEnvironFlags(&c.EnvName, f) 21 addEnvironFlags(&c.EnvName, f)
22 f.BoolVar(&c.UploadTools, "upload-tools", false, "upload local version o f tools before bootstrapping")
21 if err := f.Parse(true, args); err != nil { 23 if err := f.Parse(true, args); err != nil {
22 return err 24 return err
23 } 25 }
24 return cmd.CheckEmpty(f.Args()) 26 return cmd.CheckEmpty(f.Args())
25 } 27 }
26 28
27 // Run connects to the environment specified on the command line and bootstraps 29 // Run connects to the environment specified on the command line and bootstraps
28 // a juju in that environment if none already exists. 30 // a juju in that environment if none already exists.
29 func (c *BootstrapCommand) Run(_ *cmd.Context) error { 31 func (c *BootstrapCommand) Run(_ *cmd.Context) error {
30 conn, err := juju.NewConn(c.EnvName) 32 conn, err := juju.NewConn(c.EnvName)
31 if err != nil { 33 if err != nil {
32 return err 34 return err
33 } 35 }
34 » return conn.Bootstrap() 36 » return conn.Bootstrap(c.UploadTools)
35 } 37 }
OLDNEW
« no previous file with comments | « [revision details] ('k') | cmd/juju/cmd_test.go » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b