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

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

Issue 8545043: environs: extract tools package
Patch Set: environs: extract tools package Created 10 years, 11 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/main_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 "fmt" 4 "fmt"
5 "launchpad.net/gnuflag" 5 "launchpad.net/gnuflag"
6 "launchpad.net/juju-core/charm" 6 "launchpad.net/juju-core/charm"
7 "launchpad.net/juju-core/cmd" 7 "launchpad.net/juju-core/cmd"
8 "launchpad.net/juju-core/constraints" 8 "launchpad.net/juju-core/constraints"
9 "launchpad.net/juju-core/environs" 9 "launchpad.net/juju-core/environs"
10 "launchpad.net/juju-core/environs/tools"
10 "os" 11 "os"
11 "strings" 12 "strings"
12 ) 13 )
13 14
14 // BootstrapCommand is responsible for launching the first machine in a juju 15 // BootstrapCommand is responsible for launching the first machine in a juju
15 // environment, and setting up everything necessary to continue working. 16 // environment, and setting up everything necessary to continue working.
16 type BootstrapCommand struct { 17 type BootstrapCommand struct {
17 EnvCommandBase 18 EnvCommandBase
18 Constraints constraints.Value 19 Constraints constraints.Value
19 UploadTools bool 20 UploadTools bool
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 } 58 }
58 return err 59 return err
59 } 60 }
60 // TODO: if in verbose mode, write out to Stdout if a new cert was creat ed. 61 // TODO: if in verbose mode, write out to Stdout if a new cert was creat ed.
61 _, err = environs.EnsureCertificate(environ, environs.WriteCertAndKeyToH ome) 62 _, err = environs.EnsureCertificate(environ, environs.WriteCertAndKeyToH ome)
62 if err != nil { 63 if err != nil {
63 return err 64 return err
64 } 65 }
65 66
66 if c.UploadTools { 67 if c.UploadTools {
67 » » tools, err := environs.PutTools(environ.Storage(), nil, c.FakeSe ries...) 68 » » tools, err := tools.Upload(environ.Storage(), nil, c.FakeSeries. ..)
68 if err != nil { 69 if err != nil {
69 return err 70 return err
70 } 71 }
71 cfg, err := environ.Config().Apply(map[string]interface{}{ 72 cfg, err := environ.Config().Apply(map[string]interface{}{
72 "agent-version": tools.Number.String(), 73 "agent-version": tools.Number.String(),
73 }) 74 })
74 if err == nil { 75 if err == nil {
75 err = environ.SetConfig(cfg) 76 err = environ.SetConfig(cfg)
76 } 77 }
77 if err != nil { 78 if err != nil {
(...skipping 14 matching lines...) Expand all
92 return fmt.Errorf("invalid series name %q", name) 93 return fmt.Errorf("invalid series name %q", name)
93 } 94 }
94 } 95 }
95 *v.target = names 96 *v.target = names
96 return nil 97 return nil
97 } 98 }
98 99
99 func (v seriesVar) String() string { 100 func (v seriesVar) String() string {
100 return strings.Join(*v.target, ",") 101 return strings.Join(*v.target, ",")
101 } 102 }
OLDNEW
« no previous file with comments | « [revision details] ('k') | cmd/juju/main_test.go » ('j') | no next file with comments »

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