Looking very nice, basically just quibbles. And I'm not quite clear
about the distinction between a nil policy and a PolicyBase{} -- what
exactly governs which you use in a given situation?
https://codereview.appspot.com/61520045/diff/20001/cmd/jujud/bootstrap_test.go#newcode121
cmd/jujud/bootstrap_test.go:121: }, state.DefaultDialOpts(),
state.Policy(nil))
I'm wondering whether it might be good to have a package that implements
environStatePolicy, and includes a state.Open wrapper that always passes
the environ policy in. I'm not sure I can see a use case for alternative
policies at the moment, and if one does show up I think it'll be pretty
easy to add.
As it is I feel it's a bit icky having the nil policies everywhere -- I
think we probably want all our states to work the same in-test and out.
Open to counterarguments though.
Looking very nice, basically just quibbles. And I'm not quite clear
about the distinction between a nil policy and a PolicyBase{} -- what
exactly governs which you use in a given situation?
https:/ /codereview. appspot. com/61520045/ diff/20001/ cmd/jujud/ bootstrap_ test.go bootstrap_ test.go (right):
File cmd/jujud/
https:/ /codereview. appspot. com/61520045/ diff/20001/ cmd/jujud/ bootstrap_ test.go# newcode121 bootstrap_ test.go: 121: }, state.DefaultDi alOpts( ),
cmd/jujud/
state.Policy(nil))
I'm wondering whether it might be good to have a package that implements
environStatePolicy, and includes a state.Open wrapper that always passes
the environ policy in. I'm not sure I can see a use case for alternative
policies at the moment, and if one does show up I think it'll be pretty
easy to add.
As it is I feel it's a bit icky having the nil policies everywhere -- I
think we probably want all our states to work the same in-test and out.
Open to counterarguments though.
https:/ /codereview. appspot. com/61520045/ diff/20001/ cmd/jujud/ statepolicy. go statepolicy. go (right):
File cmd/jujud/
https:/ /codereview. appspot. com/61520045/ diff/20001/ cmd/jujud/ statepolicy. go#newcode25 statepolicy. go:25: return p, nil without- error. Can we have a specific
cmd/jujud/
I don't really like the nil-return-
sort of NotImplemented error that we handle explicitly in
precheckInstance, please?
https:/ /codereview. appspot. com/61520045/ diff/20001/ juju/conn. go
File juju/conn.go (right):
https:/ /codereview. appspot. com/61520045/ diff/20001/ juju/conn. go#newcode57
juju/conn.go:57: policy := state.PolicyBase{}
This bit doesn't have to use the mooted wrapper, ofc.
*but* I don't quite understand what the benefit is of having a null
policy here. What breaks down if we use a real one?
https:/ /codereview. appspot. com/61520045/ diff/20001/ state/policy. go
File state/policy.go (right):
https:/ /codereview. appspot. com/61520045/ diff/20001/ state/policy. go#newcode17
state/policy.go:17: // for any of the interfaces, but should only return
I think you a word.
https:/ /codereview. appspot. com/61520045/ diff/20001/ state/policy. go#newcode43
state/policy.go:43: return nil, nil
yeah, `nil, nil` scares me. Please change it :).
https:/ /codereview. appspot. com/61520045/