Yes I agree. I think that we should potentially pass in both the old
and new config to SetEnvironConfig in order to determine changes. Then
we could add conditions to the update to make sure that we aren't
updating something that someone else has tweaked in the mean time, and
that we wouldn't wipe out someone else's changes. Filed bug lp:1167616
and added a card to the backlog.
I think that given we already had a way for validations to be done it
was reasonable to use it. Black lists don't need as much updating as
new values are added. Black lists are obviously easier to implement,
but I am open to an alternative if we need to change it later.
https://codereview.appspot.com/8610043/diff/1/environs/config/config.go#newcode138
environs/config/config.go:138: // The schema always makes sure something
is set.
On 2013/04/10 12:45:20, fwereade wrote:
> This shouldn't be the case -- it should be ok to bootstrap without an
explicit
> agent-version, and have juju select appropriate tools. (That's the one
case I am
> happy with slightly-fuzzy tools selection.)
As discussed on IRC, we'll leave this change here for now.
Will repropose too.
https:/ /codereview. appspot. com/8610043/ diff/1/ cmd/juju/ environment. go environment. go (right):
File cmd/juju/
https:/ /codereview. appspot. com/8610043/ diff/1/ cmd/juju/ environment. go#newcode117 environment. go:117: c.values[key] = bits[1]
cmd/juju/
On 2013/04/10 12:45:20, fwereade wrote:
> Hmm, do we have some key=value parsing code elsewhere? Not a blocker,
but maybe
> worth a TODO.
Done.
https:/ /codereview. appspot. com/8610043/ diff/1/ cmd/juju/ environment. go#newcode132 environment. go:132: stateConfig, err := EnvironConfig( )
cmd/juju/
conn.State.
On 2013/04/10 12:45:20, fwereade wrote:
> oldConfig, to go with newConfig below?
Done.
https:/ /codereview. appspot. com/8610043/ diff/1/ cmd/juju/ environment. go#newcode147 environment. go:147: // Now try to apply the new validate validated/
cmd/juju/
config.
On 2013/04/10 12:45:20, fwereade wrote:
> s/validate/
Done.
https:/ /codereview. appspot. com/8610043/ diff/1/ cmd/juju/ environment. go#newcode148 environment. go:148: return SetEnvironConfi g(newProviderCo nfig)
cmd/juju/
conn.State.
On 2013/04/10 12:45:20, fwereade wrote:
> I'm still concerned about the behaviour of SetEnvironConfig, but
that's
> orthogonal.
Yes I agree. I think that we should potentially pass in both the old
and new config to SetEnvironConfig in order to determine changes. Then
we could add conditions to the update to make sure that we aren't
updating something that someone else has tweaked in the mean time, and
that we wouldn't wipe out someone else's changes. Filed bug lp:1167616
and added a card to the backlog.
https:/ /codereview. appspot. com/8610043/ diff/1/ cmd/juju/ environment_ test.go environment_ test.go (right):
File cmd/juju/
https:/ /codereview. appspot. com/8610043/ diff/1/ cmd/juju/ environment_ test.go# newcode130 environment_ test.go: 130: }
cmd/juju/
On 2013/04/10 12:45:20, fwereade wrote:
> test for more than one value?
Sure... if you feel the need. I do have a test above for the parsing of
the options given multiple values, but we can do this...
https:/ /codereview. appspot. com/8610043/ diff/1/ cmd/juju/ environment_ test.go# newcode140 environment_ test.go: 140: for name, value := range Tests {
cmd/juju/
immutableConfig
On 2013/04/10 12:45:20, fwereade wrote:
> I would still prefer a whitelist to a blacklist, but we don't need to
do that
> this CL (and I might be argued out of it anyway).
I think that given we already had a way for validations to be done it
was reasonable to use it. Black lists don't need as much updating as
new values are added. Black lists are obviously easier to implement,
but I am open to an alternative if we need to change it later.
https:/ /codereview. appspot. com/8610043/ diff/1/ environs/ config/ config. go config/ config. go (right):
File environs/
https:/ /codereview. appspot. com/8610043/ diff/1/ environs/ config/ config. go#newcode122 config/ config. go:122: // it if necessary, and returns the
environs/
validated configuration. If old is not
On 2013/04/10 12:45:20, fwereade wrote:
> Doesn't return a validated config
Done.
https:/ /codereview. appspot. com/8610043/ diff/1/ environs/ config/ config. go#newcode138 config/ config. go:138: // The schema always makes sure something
environs/
is set.
On 2013/04/10 12:45:20, fwereade wrote:
> This shouldn't be the case -- it should be ok to bootstrap without an
explicit
> agent-version, and have juju select appropriate tools. (That's the one
case I am
> happy with slightly-fuzzy tools selection.)
As discussed on IRC, we'll leave this change here for now.
https:/ /codereview. appspot. com/8610043/ diff/1/ environs/ config/ config. go#newcode337 config/ config. go:337: "agent-version": CurrentNumber( ).String( ),
environs/
version.
On 2013/04/10 12:45:20, fwereade wrote:
> Unset should be valid
As above, keep this for now until your change appears.
https:/ /codereview. appspot. com/8610043/