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

Side by Side Diff: cmd/builddb/main.go

Issue 6819115: environs: add a certificate argument to Bootstrap
Patch Set: environs: add a certificate argument to Bootstrap Created 12 years, 4 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/bootstrap.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/juju-core/charm" 4 "launchpad.net/juju-core/charm"
5 "launchpad.net/juju-core/environs" 5 "launchpad.net/juju-core/environs"
6 "launchpad.net/juju-core/juju" 6 "launchpad.net/juju-core/juju"
7 "launchpad.net/juju-core/log" 7 "launchpad.net/juju-core/log"
8 "launchpad.net/juju-core/state" 8 "launchpad.net/juju-core/state"
9 corelog "log" 9 corelog "log"
10 "os" 10 "os"
11 "path/filepath" 11 "path/filepath"
12 "time" 12 "time"
13 13
14 // Register the provider 14 // Register the provider
15 _ "launchpad.net/juju-core/environs/ec2" 15 _ "launchpad.net/juju-core/environs/ec2"
16 ) 16 )
17 17
18 func main() { 18 func main() {
19 log.Target = corelog.New(os.Stdout, "", corelog.LstdFlags) 19 log.Target = corelog.New(os.Stdout, "", corelog.LstdFlags)
20 if err := build(); err != nil { 20 if err := build(); err != nil {
21 corelog.Fatalf("error: %v", err) 21 corelog.Fatalf("error: %v", err)
22 } 22 }
23 } 23 }
24 24
25 func build() error { 25 func build() error {
26 environ, err := environs.NewFromName("") 26 environ, err := environs.NewFromName("")
27 if err != nil { 27 if err != nil {
28 return err 28 return err
29 } 29 }
30 » err = environ.Bootstrap(true) 30 » // TODO (rog) use juju.Bootstrap
31 » err = environ.Bootstrap(true, []byte("fake cert"))
31 if err != nil { 32 if err != nil {
32 return err 33 return err
33 } 34 }
34 conn, err := juju.NewConn(environ) 35 conn, err := juju.NewConn(environ)
35 if err != nil { 36 if err != nil {
36 return err 37 return err
37 } 38 }
38 repo := &charm.LocalRepository{filepath.Dir(os.Args[0])} 39 repo := &charm.LocalRepository{filepath.Dir(os.Args[0])}
39 curl := charm.MustParseURL("local:precise/builddb") 40 curl := charm.MustParseURL("local:precise/builddb")
40 ch, err := conn.PutCharm(curl, repo, false) 41 ch, err := conn.PutCharm(curl, repo, false)
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 return nil 84 return nil
84 } 85 }
85 86
86 func logStatus(status state.UnitStatus, info string) { 87 func logStatus(status state.UnitStatus, info string) {
87 if info == "" { 88 if info == "" {
88 log.Printf("builddb: Unit status is %q", status) 89 log.Printf("builddb: Unit status is %q", status)
89 } else { 90 } else {
90 log.Printf("builddb: Unit status is %q: %s", status, info) 91 log.Printf("builddb: Unit status is %q: %s", status, info)
91 } 92 }
92 } 93 }
OLDNEW
« no previous file with comments | « [revision details] ('k') | cmd/juju/bootstrap.go » ('j') | no next file with comments »

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