https://codereview.appspot.com/70190050/diff/60001/cmd/juju/environment_test.go#newcode173
cmd/juju/environment_test.go:173: c.Check(err, gc.ErrorMatches, `no
registered provider for "foo"`)
On 2014/03/10 03:41:54, axw wrote:
> This has nothing to do with attribute mutability, so doesn't belong
here. Why
> not just change the value in the map to a real provider type? You will
need to
> make sure the provider is registered by importing its package.
https://codereview.appspot.com/70190050/diff/60001/environs/config.go#newcode138
environs/config.go:138: func Provider(providerType string)
(EnvironProvider, error) {
On 2014/03/10 03:41:54, axw wrote:
> Making cosmetic changes is fine, but it's best not to mix cosmetic
changes (or
> refactoring) with functional changes. Otherwise I'm scrutinising
everything to
> make sure there's no functional change, and the review takes longer
than
> necessary.
Sorry about that. This branch is actually three squashed together. These
changes are in response to William's review of one of those branches.
Done. I couldn't cast or assert secrets (which is map[string]string) to
map[string]interface{}, so I created a new var secretAttrs with that
type instead.
https://codereview.appspot.com/70190050/diff/60001/state/api/firewaller/state_test.go#newcode94
state/api/firewaller/state_test.go:94: // TODO [waigani] test removing
an attribute.
On 2014/03/10 03:41:54, axw wrote:
> I don't think deferral is warranted here. Not sure it's really
necessary to add
> the test either, though: firewaller doesn't care about attributes
being removed.
Done. TODO removed.
https://codereview.appspot.com/70190050/diff/60001/state/api/firewaller/state_test.go#newcode94
state/api/firewaller/state_test.go:94: // TODO [waigani] test removing
an attribute.
On 2014/03/10 03:41:54, axw wrote:
> I don't think deferral is warranted here. Not sure it's really
necessary to add
> the test either, though: firewaller doesn't care about attributes
being removed.
https://codereview.appspot.com/70190050/diff/60001/state/apiserver/client/client.go#newcode775
state/apiserver/client/client.go:775: oldConfig, err :=
c.api.state.EnvironConfig()
On 2014/03/10 03:41:54, axw wrote:
> This is a bit ugly, requiring another load. I wonder if we could pass
an
> additional validation function down to UpdateEnvironConfig...
> Just a thought, not blocking.
Done. UpdateEnvironConfig now takes an additionalValidation func
Please take a look.
https:/ /codereview. appspot. com/70190050/ diff/60001/ cmd/juju/ environment. go environment. go (right):
File cmd/juju/
https:/ /codereview. appspot. com/70190050/ diff/60001/ cmd/juju/ environment. go#newcode166 environment. go:166: return UpdateEnvironCo nfig(c. values, []string{})
cmd/juju/
conn.State.
On 2014/03/10 03:41:54, axw wrote:
> Just nil is fine.
Done.
https:/ /codereview. appspot. com/70190050/ diff/60001/ cmd/juju/ environment_ test.go environment_ test.go (right):
File cmd/juju/
https:/ /codereview. appspot. com/70190050/ diff/60001/ cmd/juju/ environment_ test.go# newcode173 environment_ test.go: 173: c.Check(err, gc.ErrorMatches, `no
cmd/juju/
registered provider for "foo"`)
On 2014/03/10 03:41:54, axw wrote:
> This has nothing to do with attribute mutability, so doesn't belong
here. Why
> not just change the value in the map to a real provider type? You will
need to
> make sure the provider is registered by importing its package.
Done.
https:/ /codereview. appspot. com/70190050/ diff/60001/ environs/ config. go
File environs/config.go (right):
https:/ /codereview. appspot. com/70190050/ diff/60001/ environs/ config. go#newcode138 config. go:138: func Provider( providerType string)
environs/
(EnvironProvider, error) {
On 2014/03/10 03:41:54, axw wrote:
> Making cosmetic changes is fine, but it's best not to mix cosmetic
changes (or
> refactoring) with functional changes. Otherwise I'm scrutinising
everything to
> make sure there's no functional change, and the review takes longer
than
> necessary.
Sorry about that. This branch is actually three squashed together. These
changes are in response to William's review of one of those branches.
https:/ /codereview. appspot. com/70190050/ diff/60001/ juju/conn. go
File juju/conn.go (right):
https:/ /codereview. appspot. com/70190050/ diff/60001/ juju/conn. go#newcode155 UpdateEnvironCo nfig(attrs, []string{})
juju/conn.go:155: return c.State.
On 2014/03/10 03:41:54, axw wrote:
> Just pass secrets here, and don't bother updating attrs in the loop.
Done. I couldn't cast or assert secrets (which is map[string]string) to interface{ }, so I created a new var secretAttrs with that
map[string]
type instead.
https:/ /codereview. appspot. com/70190050/ diff/60001/ state/api/ firewaller/ state_test. go firewaller/ state_test. go (right):
File state/api/
https:/ /codereview. appspot. com/70190050/ diff/60001/ state/api/ firewaller/ state_test. go#newcode94 firewaller/ state_test. go:94: // TODO [waigani] test removing
state/api/
an attribute.
On 2014/03/10 03:41:54, axw wrote:
> I don't think deferral is warranted here. Not sure it's really
necessary to add
> the test either, though: firewaller doesn't care about attributes
being removed.
Done. TODO removed.
https:/ /codereview. appspot. com/70190050/ diff/60001/ state/api/ firewaller/ state_test. go#newcode94 firewaller/ state_test. go:94: // TODO [waigani] test removing
state/api/
an attribute.
On 2014/03/10 03:41:54, axw wrote:
> I don't think deferral is warranted here. Not sure it's really
necessary to add
> the test either, though: firewaller doesn't care about attributes
being removed.
https:/ /codereview. appspot. com/70190050/ diff/60001/ state/apiserver /client/ client. go /client/ client. go (right):
File state/apiserver
https:/ /codereview. appspot. com/70190050/ diff/60001/ state/apiserver /client/ client. go#newcode775 /client/ client. go:775: oldConfig, err := EnvironConfig( ) nfig...
state/apiserver
c.api.state.
On 2014/03/10 03:41:54, axw wrote:
> This is a bit ugly, requiring another load. I wonder if we could pass
an
> additional validation function down to UpdateEnvironCo
> Just a thought, not blocking.
Done. UpdateEnvironConfig now takes an additionalValid ation func
https:/ /codereview. appspot. com/70190050/ diff/60001/ state/apiserver /client/ client. go#newcode785 /client/ client. go:785: // TODO [waigani] Add a txn retry
state/apiserver
loop
On 2014/03/10 03:41:54, axw wrote:
> We have a standard format for TODOs:
> // TODO(user) YYYY-MM-DD #issue
> // A brief summary of the issue here.
> Please file an issue if there's not one already (I think the one I
referred to
> in state.go is suitable, so just refer to that).
Done. I also returned your TODO comment in state.go. Thanks for showing
me the standard.
https:/ /codereview. appspot. com/70190050/ diff/60001/ state/apiserver /client/ client. go#newcode786 /client/ client. go:786: return UpdateEnvironCo nfig(args. Config, []string{})
state/apiserver
c.api.state.
On 2014/03/10 03:41:54, axw wrote:
> The second argument can simply be nil.
Done. I changed all calls.
https:/ /codereview. appspot. com/70190050/ diff/60001/ state/apiserver /keymanager/ keymanager. go /keymanager/ keymanager. go (left):
File state/apiserver
https:/ /codereview. appspot. com/70190050/ diff/60001/ state/apiserver /keymanager/ keymanager. go#oldcode311 /keymanager/ keymanager. go:311: // For now, authorised
state/apiserver
keys are global, common to all users.
On 2014/03/10 03:41:54, axw wrote:
> This comment didn't need to be deleted
I'm confused. The comment is still there on line 312?
https:/ /codereview. appspot. com/70190050/ diff/60001/ state/state. go
File state/state.go (left):
https:/ /codereview. appspot. com/70190050/ diff/60001/ state/state. go#oldcode265 haven't- changed
state/state.go:265: // TODO(axw) 2013-12-6 #1167616
On 2014/03/10 03:41:54, axw wrote:
> The TODO will not be resolved until the settings-
assertion is in
> place. Please do not delete it until then,.
Done.
https:/ /codereview. appspot. com/70190050/ diff/60001/ state/state. go
File state/state.go (right):
https:/ /codereview. appspot. com/70190050/ diff/60001/ state/state. go#newcode259
state/state.go:259: // DELETE ME
On 2014/03/10 03:41:54, axw wrote:
> DELETE ME
Done.
https:/ /codereview. appspot. com/70190050/ diff/60001/ state/state. go#newcode305 New(config. NoDefaults,
state/state.go:305: oldConfig, err := config.
existingAttrs)
On 2014/03/10 03:41:54, axw wrote:
> I think there's no reason not to inline settings.Map() here.
Done.
https:/ /codereview. appspot. com/70190050/ diff/60001/ state/testing/ config. go config. go (right):
File state/testing/
https:/ /codereview. appspot. com/70190050/ diff/60001/ state/testing/ config. go#newcode10 config. go:10: // TODO [waigani] replace UpdateConfig with
state/testing/
UpdateEnvironConfig
On 2014/03/10 03:41:54, axw wrote:
> Please either do it or create a TODO(waigaini) with accompanying
issue.
Done. UpdateConfig replaced.
https:/ /codereview. appspot. com/70190050/ diff/60001/ worker/ environ_ test.go environ_ test.go (left):
File worker/
https:/ /codereview. appspot. com/70190050/ diff/60001/ worker/ environ_ test.go# oldcode49 environ_ test.go: 49: // Create an invalid config by taking the
worker/
current config and
On 2014/03/10 03:41:54, axw wrote:
> This shouldn't go until UpdateEnvironConfig is completely fixed.
I see that TestInvalidConfig is no longer in trunk, so I assume to is
fine to leave this deleted?
https:/ /codereview. appspot. com/70190050/ diff/60001/ worker/ instancepoller/ observer_ test.go instancepoller/ observer_ test.go (left):
File worker/
https:/ /codereview. appspot. com/70190050/ diff/60001/ worker/ instancepoller/ observer_ test.go# oldcode51 instancepoller/ observer_ test.go: 51: oldType = type"]. (string)
worker/
attrs["
On 2014/03/10 03:41:54, axw wrote:
> Again, don't delete until UpdateEnvironConfig is fixed. Open a state
conn with
> nil validator here if you have to.
Done.
https:/ /codereview. appspot. com/70190050/ diff/60001/ worker/ machineenvironm entworker/ machineenvironm entworker_ test.go machineenvironm entworker/ machineenvironm entworker_ test.go
File worker/
(right):
https:/ /codereview. appspot. com/70190050/ diff/60001/ worker/ machineenvironm entworker/ machineenvironm entworker_ test.go# newcode128 machineenvironm entworker/ machineenvironm entworker_ test.go: 128: interface{ }{} string] interface{ })
worker/
attrs := map[string]
On 2014/03/10 03:41:54, axw wrote:
> The conventional way to write this is
> attrs := make(map[
Ah. There are a lot of map[string] interface{ }{} around (from my code and
others). Shall I put off changing these to another day/branch?
https:/ /codereview. appspot. com/70190050/