juju/juju — pull request #911 by dimitern (2014-10-15 15:36:53+00:00)
Title: Fixed a racy firewaller test for the new FwNone firewall-mode

It seems the way "firewall-mode: none" is tested in the firewaller
worker is racy, although I haven't seen any failures on my machine
or on the merge bot. John Weldon however managed to readily reproduce
the issue - http://paste.ubuntu.com/8565153/. Thanks for the report!

The correct fix actually made both the tests and the implementation
inside the worker simpler -- rather than calling worker.WaitForEnviron
inside the loop() method and assuming it can block, now it's called
directly into the NewFirewaller constructor. The reason this works is
because by the time the worker stats and connects to the API, we
*already* have a valid environment configuration and don't need to
wait for it. In fact, WaitForEnviron is on the way out and some more
simplifications can be done when it's gone, but now's not the time.