Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Add region handling to UpdateModelConfigDefaultValues #6297
Conversation
axw
approved these changes
Sep 21, 2016
LGTM, but please don't pass tag strings out of the apiserver layer.
| @@ -134,8 +135,18 @@ func (st *State) modelConfigValues(modelCfg attrValues) (config.ConfigValues, er | ||
| } | ||
| // UpdateModelConfigDefaultValues updates the inherited settings used when creating a new model. | ||
| -func (st *State) UpdateModelConfigDefaultValues(attrs map[string]interface{}, removed []string) error { | ||
| - settings, err := readSettings(st, globalSettingsC, controllerInheritedSettingsGlobalKey) | ||
| +func (st *State) UpdateModelConfigDefaultValues(attrs map[string]interface{}, removed []string, cloudTag, regionName string) error { |
| + return errors.Trace(err) | ||
| + } | ||
| + key = regionSettingsGlobalKey(cloud.Id(), regionName) | ||
| + } else { |
reedobrien
Sep 22, 2016
Contributor
Changed the machinery to use environs.RegionSpec to define the cloud/region and added a constructor that barfs if cloud or region is an empty string.
| + c.state.UpdateModelConfigDefaultValues(nil, arg.Keys, rspec), | ||
| + ) | ||
| + } else { | ||
| + results.Results[i].Error = common.ServerError( |
axw
Sep 22, 2016
Member
I think it'd be a little neater to de-dupe these two calls, and do the conditional rspec thing like you did in the other method.
reedobrien
added some commits
Sep 20, 2016
|
$$merge$$ |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
|
Build failed: Tests failed |
|
$$merge$$ |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
reedobrien commentedSep 21, 2016
•
Edited 1 time
-
reedobrien
Sep 21, 2016
Refs: model-config-tree
QA: Unit tests all pass. This should have gone in with the rest of the backend model-config region bits. But it didn't it is required for the cli bits to work, so hoping to merge this so we can get feedback on the CLI bits.