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

Delta Between Two Patch Sets: environs/openstack/config.go

Issue 11659043: Improve Openstack config deprecation warnings. (Closed)
Left Patch Set: Improve Openstack config deprecation warnings. Created 10 years, 8 months ago
Right Patch Set: Improve Openstack config deprecation warnings. Created 10 years, 8 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:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « [revision details] ('k') | environs/openstack/config_test.go » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 // Copyright 2012, 2013 Canonical Ltd. 1 // Copyright 2012, 2013 Canonical Ltd.
2 // Licensed under the AGPLv3, see LICENCE file for details. 2 // Licensed under the AGPLv3, see LICENCE file for details.
3 3
4 package openstack 4 package openstack
5 5
6 import ( 6 import (
7 "fmt" 7 "fmt"
8 "launchpad.net/goose/identity" 8 "launchpad.net/goose/identity"
9 "launchpad.net/juju-core/environs/config" 9 "launchpad.net/juju-core/environs/config"
10 "launchpad.net/juju-core/log" 10 "launchpad.net/juju-core/log"
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 "Your cloud provider should have set up image me tadata to provide the correct image id\n"+ 132 "Your cloud provider should have set up image me tadata to provide the correct image id\n"+
133 "for your chosen series and archietcure. If this is a private Openstack deployment without\n"+ 133 "for your chosen series and archietcure. If this is a private Openstack deployment without\n"+
134 "existing image metadata, please run 'juju help image-metadata' to see how suitable image"+ 134 "existing image metadata, please run 'juju help image-metadata' to see how suitable image"+
135 "metadata can be generated.", 135 "metadata can be generated.",
136 "default-image-id", defaultImageId) 136 "default-image-id", defaultImageId)
137 log.Warningf(msg) 137 log.Warningf(msg)
138 } 138 }
139 if defaultInstanceType := cfg.AllAttrs()["default-instance-type"]; defau ltInstanceType != nil && defaultInstanceType.(string) != "" { 139 if defaultInstanceType := cfg.AllAttrs()["default-instance-type"]; defau ltInstanceType != nil && defaultInstanceType.(string) != "" {
140 msg := fmt.Sprintf( 140 msg := fmt.Sprintf(
141 "Config attribute %q (%v) is deprecated and ignored.\n"+ 141 "Config attribute %q (%v) is deprecated and ignored.\n"+
142 » » » » "The correct instance flavor is now determined u sing constraints, globally specified\n"+ 142 » » » » "The correct instance flavor is determined using constraints, globally specified\n"+
rog 2013/07/22 12:45:24 s/now //
wallyworld 2013/07/23 05:03:47 Done.
143 "when an environment is bootstrapped, or individ ually when a charm is deployed.\n"+ 143 "when an environment is bootstrapped, or individ ually when a charm is deployed.\n"+
144 "See 'juju help bootstrap' or 'juju help deploy' .", 144 "See 'juju help bootstrap' or 'juju help deploy' .",
145 "default-instance-type", defaultInstanceType) 145 "default-instance-type", defaultInstanceType)
146 log.Warningf(msg) 146 log.Warningf(msg)
147 } 147 }
148 148
149 validated, err := cfg.ValidateUnknownAttrs(configFields, configDefaults) 149 validated, err := cfg.ValidateUnknownAttrs(configFields, configDefaults)
150 if err != nil { 150 if err != nil {
151 return nil, err 151 return nil, err
152 } 152 }
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 return nil, fmt.Errorf("cannot change region from %q to %q", region, ecfg.region()) 221 return nil, fmt.Errorf("cannot change region from %q to %q", region, ecfg.region())
222 } 222 }
223 if controlBucket, _ := attrs["control-bucket"].(string); ecfg.co ntrolBucket() != controlBucket { 223 if controlBucket, _ := attrs["control-bucket"].(string); ecfg.co ntrolBucket() != controlBucket {
224 return nil, fmt.Errorf("cannot change control-bucket fro m %q to %q", controlBucket, ecfg.controlBucket()) 224 return nil, fmt.Errorf("cannot change control-bucket fro m %q to %q", controlBucket, ecfg.controlBucket())
225 } 225 }
226 } 226 }
227 227
228 // Apply the coerced unknown values back into the config. 228 // Apply the coerced unknown values back into the config.
229 return cfg.Apply(ecfg.attrs) 229 return cfg.Apply(ecfg.attrs)
230 } 230 }
LEFTRIGHT

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