juju/juju — pull request #593 by dimitern (2014-08-22 12:59:55+00:00)
Title: Refactored networker significantly to simplify it and improved testing and logging.

Summary of changes:
* No more using global variables.
* Using names.MachineTag internally, not a string.
* No state split in 3 places and coupled in a way making it very hard to test (dropped state.go and implemented ConfigFile which knows how to read its data and render its own config).
* No more reading and parsing network config files, just rewritting them with managed config as needed.
* VLAN module loading is only done if needed.
* Much better and simpler tests.
* Live tested on MAAS and local (trusty, precise, utopic).
* Disabling a physical interface causes any dependents to be disabled as well (i.e. VLANs and other virtual interfaces with the same MAC).
* Rather than parsing (obsolete) network config files, the available network interfaces on the machine are discovered using the net package's functions (updates happen in real-time).
* Much, much better logging (mostly on DEBUG level, but not always)
* Not a simple NotifyWorker anymore, as it needs to do more things, i.e. implemented a full-scale worker loop, etc.
* IMO much easier to read, understand and maintain the code after refactoring.