mostly LGTM apart from the watcher stopping below, and the unsafe testing access.
https://codereview.appspot.com/6374069/diff/1/worker/firewaller/firewaller.go File worker/firewaller/firewaller.go (right):
https://codereview.appspot.com/6374069/diff/1/worker/firewaller/firewaller.go#newcode42 worker/firewaller/firewaller.go:42: // Get environment first. defer watcher.Stop(fw.machineUnitsChanges, &fw.tomb)
https://codereview.appspot.com/6374069/diff/1/worker/firewaller/firewaller.go#newcode43 worker/firewaller/firewaller.go:43: fw.environWatcher = fw.st.WatchEnvironConfig() defer watcher.Stop(fw.environWatcher, &fw.tomb)
https://codereview.appspot.com/6374069/diff/1/worker/firewaller/firewaller.go#newcode54 worker/firewaller/firewaller.go:54: return this isn't killing the machines watcher
https://codereview.appspot.com/6374069/diff/1/worker/firewaller/firewaller.go#newcode69 worker/firewaller/firewaller.go:69: return this isn't killing the environs watcher
https://codereview.appspot.com/6374069/diff/1/worker/firewaller/firewaller.go#newcode90 worker/firewaller/firewaller.go:90: // TODO(mue) fill with life. i like the image :-)
https://codereview.appspot.com/6374069/diff/1/worker/firewaller/firewaller_test.go File worker/firewaller/firewaller_test.go (right):
https://codereview.appspot.com/6374069/diff/1/worker/firewaller/firewaller_test.go#newcode100 worker/firewaller/firewaller_test.go:100: allMachines := fw.AllMachines() i liked this initially, but after a moment's thought, i'm not sure about it - it accesses fw.machines in a non-thread-safe way and it makes the test slower than it should be.
i'll have a chat online about this - i have an idea :-)
https://codereview.appspot.com/6374069/
« Back to merge proposal
mostly LGTM apart from the watcher stopping below,
and the unsafe testing access.
https:/ /codereview. appspot. com/6374069/ diff/1/ worker/ firewaller/ firewaller. go firewaller/ firewaller. go (right):
File worker/
https:/ /codereview. appspot. com/6374069/ diff/1/ worker/ firewaller/ firewaller. go#newcode42 firewaller/ firewaller. go:42: // Get environment first. Stop(fw. machineUnitsCha nges, &fw.tomb)
worker/
defer watcher.
https:/ /codereview. appspot. com/6374069/ diff/1/ worker/ firewaller/ firewaller. go#newcode43 firewaller/ firewaller. go:43: fw.environWatcher = ronConfig( ) Stop(fw. environWatcher, &fw.tomb)
worker/
fw.st.WatchEnvi
defer watcher.
https:/ /codereview. appspot. com/6374069/ diff/1/ worker/ firewaller/ firewaller. go#newcode54 firewaller/ firewaller. go:54: return
worker/
this isn't killing the machines watcher
https:/ /codereview. appspot. com/6374069/ diff/1/ worker/ firewaller/ firewaller. go#newcode69 firewaller/ firewaller. go:69: return
worker/
this isn't killing the environs watcher
https:/ /codereview. appspot. com/6374069/ diff/1/ worker/ firewaller/ firewaller. go#newcode90 firewaller/ firewaller. go:90: // TODO(mue) fill with life.
worker/
i like the image :-)
https:/ /codereview. appspot. com/6374069/ diff/1/ worker/ firewaller/ firewaller_ test.go firewaller/ firewaller_ test.go (right):
File worker/
https:/ /codereview. appspot. com/6374069/ diff/1/ worker/ firewaller/ firewaller_ test.go# newcode100 firewaller/ firewaller_ test.go: 100: allMachines :=
worker/
fw.AllMachines()
i liked this initially, but after a moment's thought, i'm not sure about
it - it accesses fw.machines in a non-thread-safe way and it makes the
test slower than it should be.
i'll have a chat online about this - i have an idea :-)
https:/ /codereview. appspot. com/6374069/