Looks pretty good but we need a juju/machine_test to test that the jujud
has started the worker properly. There's a few examples in machine_test
to look at.
https://codereview.appspot.com/57600043/diff/1/worker/machineenvironmentworker/machineenvironmentworker_test.go#newcode41
worker/machineenvironmentworker/machineenvironmentworker_test.go:41: var
_ = gc.Suite(&MachineEnvironmentWatcherSuite{})
I can't see a test that explicitly check that receiving the initial
event does what is needed ie the business logic associated with the
"first" attribute. If it is there, perhaps a comment to show where it is
tested. Is that what TestInitialState does? I'd actually prefer we
didn't need the "first" attribute :-)
Looks pretty good but we need a juju/machine_test to test that the jujud
has started the worker properly. There's a few examples in machine_test
to look at.
https:/ /codereview. appspot. com/57600043/ diff/1/ worker/ machineenvironm entworker/ machineenvironm entworker. go machineenvironm entworker/ machineenvironm entworker. go
File worker/
(right):
https:/ /codereview. appspot. com/57600043/ diff/1/ worker/ machineenvironm entworker/ machineenvironm entworker. go#newcode30 machineenvironm entworker/ machineenvironm entworker. go:30:
worker/
ProxyDirectory = "/home/ubuntu"
Not sure if other workers use ~ubuntu and/or /home/ubuntu, but if they
do , would be good to make this a const or method call.
https:/ /codereview. appspot. com/57600043/ diff/1/ worker/ machineenvironm entworker/ machineenvironm entworker. go#newcode50 machineenvironm entworker/ machineenvironm entworker. go:50: first
worker/
bool
Do other workers use first? Don't they just suck up the initial event
and deal with it? It seems a little complicated to use it here. If we do
need to use it, perhaps a comment saying why we need it here.
https:/ /codereview. appspot. com/57600043/ diff/1/ worker/ machineenvironm entworker/ machineenvironm entworker. go#newcode77 machineenvironm entworker/ machineenvironm entworker. go:77: // an
worker/
ubuntu user, it will. This shouldn't be a problem.
I read the above a few times and am still not sure I've parsed it
correctly. I think "should" might need to be "shouldn't"??
https:/ /codereview. appspot. com/57600043/ diff/1/ worker/ machineenvironm entworker/ machineenvironm entworker. go#newcode85 machineenvironm entworker/ machineenvironm entworker. go:85: // same
worker/
way that the file is writting in the cloud-init process, so
s/writting/written ?
https:/ /codereview. appspot. com/57600043/ diff/1/ worker/ machineenvironm entworker/ machineenvironm entworker. go#newcode122 machineenvironm entworker/ machineenvironm entworker. go:122: tings()
worker/
aptSettings := env.AptProxySet
not sure if we want the 2 lots of logic in this method in separate sub
methods so onChange is dead easy to ready
https:/ /codereview. appspot. com/57600043/ diff/1/ worker/ machineenvironm entworker/ machineenvironm entworker. go#newcode137 machineenvironm entworker/ machineenvironm entworker. go:137: func (w mentWorker) SetUp() (watcher. NotifyWatcher, error) {
worker/
*MachineEnviron
Typically we add a doc string saying what interface SetUp() comes from
https:/ /codereview. appspot. com/57600043/ diff/1/ worker/ machineenvironm entworker/ machineenvironm entworker. go#newcode149 machineenvironm entworker/ machineenvironm entworker. go:149: func (w mentWorker) Handle() error {
worker/
*MachineEnviron
ditto
https:/ /codereview. appspot. com/57600043/ diff/1/ worker/ machineenvironm entworker/ machineenvironm entworker. go#newcode153 machineenvironm entworker/ machineenvironm entworker. go:153: func (w mentWorker) TearDown() error {
worker/
*MachineEnviron
ditto
https:/ /codereview. appspot. com/57600043/ diff/1/ worker/ machineenvironm entworker/ machineenvironm entworker_ test.go machineenvironm entworker/ machineenvironm entworker_ test.go
File worker/
(right):
https:/ /codereview. appspot. com/57600043/ diff/1/ worker/ machineenvironm entworker/ machineenvironm entworker_ test.go# newcode41 machineenvironm entworker/ machineenvironm entworker_ test.go: 41: var &MachineEnviron mentWatcherSuit e{})
worker/
_ = gc.Suite(
I can't see a test that explicitly check that receiving the initial
event does what is needed ie the business logic associated with the
"first" attribute. If it is there, perhaps a comment to show where it is
tested. Is that what TestInitialState does? I'd actually prefer we
didn't need the "first" attribute :-)
https:/ /codereview. appspot. com/57600043/