Merge lp:~jtv/maas/flatten-dnszoneconfig into lp:~maas-committers/maas/trunk
Status: | Merged |
---|---|
Approved by: | Jeroen T. Vermeulen |
Approved revision: | no longer in the source branch. |
Merged at revision: | 1839 |
Proposed branch: | lp:~jtv/maas/flatten-dnszoneconfig |
Merge into: | lp:~maas-committers/maas/trunk |
Diff against target: |
223 lines (+27/-60) 3 files modified
src/maasserver/dns.py (+1/-2) src/provisioningserver/dns/config.py (+17/-43) src/provisioningserver/dns/tests/test_config.py (+9/-15) |
To merge this branch: | bzr merge lp:~jtv/maas/flatten-dnszoneconfig |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Gavin Panella (community) | Approve | ||
Review via email: mp+202509@code.launchpad.net |
Commit message
Collapse DNSConfigBase into DNSZoneConfigBase.
Description of the change
Now that DNSConfig is no longer in the family, DNSConfigBase and DNSZoneConfigBase no longer need to be separate classes. This branch combines them, and some of the complexity falls out along the way. To keep refactoring work light, I hard-coded the zone files' access permissions (we never used the property) and to keep a handle on data flows, I moved dns_ip down to DNSForwardZoneC
At this point the data flows within the hierarchy become much clearer. They could be shortened a bit further still by passing the mappings and context to the base-class constructor as parameters, instead of having the base class retrieve them by calling overridable methods on itself. Delegation may be more appropriate than a common base class. The constructors for the concrete classes might be a bit easier to grasp if they named their parameters instead of accepting *args and **kwargs. Finally, I suppose shortened_
Jeroen
Looks good. One thing to consider.
[1]
- networks = kwargs. pop("networks" , None) pop('networks' , [])
- self.networks = [] if networks is None else networks
+ self.networks = kwargs.
This subtly changes behaviour. If kwargs["networks"] is None, this will
set self.networks to None. The original would set it to []. I'm not sure
if it's important though.