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

Unified Diff: environs/dummy/environs.go

Issue 6632049: various: set passwords in state at bootstrap time.
Patch Set: various: set passwords in state at bootstrap time. Created 12 years, 5 months ago
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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « environs/cloudinit/cloudinit.go ('k') | environs/ec2/ec2.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: environs/dummy/environs.go
=== modified file 'environs/dummy/environs.go'
--- environs/dummy/environs.go 2012-10-10 13:12:24 +0000
+++ environs/dummy/environs.go 2012-10-11 10:54:02 +0000
@@ -28,6 +28,7 @@
"launchpad.net/juju-core/schema"
"launchpad.net/juju-core/state"
"launchpad.net/juju-core/testing"
+ "launchpad.net/juju-core/trivial"
"launchpad.net/juju-core/version"
"net"
"net/http"
@@ -396,12 +397,17 @@
info := stateInfo()
cfg, err := environs.BootstrapConfig(&providerInstance, e.ecfg().Config, tools)
if err != nil {
- return err
+ return fmt.Errorf("cannot make bootstrap config: %v", err)
}
st, err := state.Initialize(info, cfg)
if err != nil {
panic(err)
}
+ if password := e.Config().AdminSecret(); password != "" {
+ if err := st.SetAdminPassword(trivial.PasswordHash(password)); err != nil {
+ return err
+ }
+ }
if err := st.Close(); err != nil {
panic(err)
}
« no previous file with comments | « environs/cloudinit/cloudinit.go ('k') | environs/ec2/ec2.go » ('j') | no next file with comments »

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