Merge lp:~jtv/maas/delegate-write_config into lp:~maas-committers/maas/trunk
Status: | Merged |
---|---|
Approved by: | Jeroen T. Vermeulen |
Approved revision: | no longer in the source branch. |
Merged at revision: | 1841 |
Proposed branch: | lp:~jtv/maas/delegate-write_config |
Merge into: | lp:~maas-committers/maas/trunk |
Diff against target: |
329 lines (+47/-89) 4 files modified
src/maasserver/dns.py (+3/-3) src/provisioningserver/dns/config.py (+33/-46) src/provisioningserver/dns/tests/test_config.py (+9/-35) src/provisioningserver/tests/test_tasks.py (+2/-5) |
To merge this branch: | bzr merge lp:~jtv/maas/delegate-write_config |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Julian Edwards (community) | Approve | ||
Review via email: mp+202595@code.launchpad.net |
Commit message
Untangle data flows between the DNSZoneConfig classes.
Description of the change
This is where my cleanups for the dns config module really come together. To understand what's going on, imagine the class hierarchy: there's an abstract DNSZoneConfigBase class, with two concrete child classes DNSForwardZoneC
In this branch you'll see:
* the "mapping" attribute move from the base class to just one child class. It was passed in other places too, but never actually used.
* zone_name become a simple instance variable, explicitly computed by the derived-class constructor and passed to the base-class constructor.
* template_path disappear, because render_dns_template already knows how to compute this path.
* get_context be demoted from an abstract method with 2 implementations to a pair of merely similar helpers.
* write_config() delegating explicitly to a base-class method, after gathering its data up-front.
* zone composition on DNSReverseZoneC
There's a bit more polish coming, but not much: the implicit data flows through instance variables within the concrete classes can now be replaced with explicit parameters, and perhaps one or two instance variables can be retired altogether. (Actually it looks as if several are currently only used for inspection by tests.) But the module is now in a state where we can see what data is needed, and what for. We can then start answering questions like "how are we going to deal with hostnames that are in multiple networks?"
Jeroen
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
review: approve www.enigmail. net/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.15 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://
iEYEARECAAYFAlL faZIACgkQWhGlTF 8G/HcYQgCglwEnM n+KP6JyY7IRuBjr pAyp NacqQDA/ jjcQ7YajA
k18AnAo2zkY3w85
=BA2Q
-----END PGP SIGNATURE-----