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

Unified Diff: provider/dummy/environs.go

Issue 13355044: environs/config: more restrictive New
Patch Set: environs/config: more restrictive New Created 11 years, 7 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 | « provider/dummy/config_test.go ('k') | provider/dummy/environs_test.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: provider/dummy/environs.go
=== modified file 'provider/dummy/environs.go'
--- provider/dummy/environs.go 2013-09-12 00:24:35 +0000
+++ provider/dummy/environs.go 2013-09-12 14:16:48 +0000
@@ -53,6 +53,28 @@
"launchpad.net/juju-core/utils"
)
+// SampleConfig() returns an environment configuration with all required
+// attributes set.
+func SampleConfig() testing.Attrs {
+ return testing.Attrs{
+ "type": "dummy",
+ "name": "only",
+ "authorized-keys": "my-keys",
+ "firewall-mode": config.FwInstance,
+ "admin-secret": "fish",
+ "ca-cert": testing.CACert,
+ "ca-private-key": testing.CAKey,
+ "ssl-hostname-verification": true,
+ "development": false,
+ "state-port": 1234,
+ "api-port": 4321,
+ "default-series": "precise",
+
+ "secret": "pork",
+ "state-server": true,
+ }
+}
+
// stateInfo returns a *state.Info which allows clients to connect to the
// shared dummy state, if it exists.
func stateInfo() *state.Info {
@@ -400,14 +422,13 @@
}
func (*environProvider) SecretAttrs(cfg *config.Config) (map[string]interface{}, error) {
- m := make(map[string]interface{})
ecfg, err := providerInstance.newConfig(cfg)
if err != nil {
return nil, err
}
- m["secret"] = ecfg.secret()
- return m, nil
-
+ return map[string]interface{}{
+ "secret": ecfg.secret(),
+ }, nil
}
func (*environProvider) PublicAddress() (string, error) {
@@ -755,7 +776,7 @@
id instance.Id
machineId string
series string
- firewallMode config.FirewallMode
+ firewallMode string
}
func (inst *dummyInstance) Id() instance.Id {
« no previous file with comments | « provider/dummy/config_test.go ('k') | provider/dummy/environs_test.go » ('j') | no next file with comments »

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