~rvb/maas/bug-1234853-1.3

« back to all changes in this revision

Viewing changes to src/maasserver/models/nodegroup.py

  • Committer: Tarmac
  • Author(s): Jeroen Vermeulen
  • Date: 2012-09-03 13:50:38 UTC
  • mfrom: (961.1.4 bug-1044203)
  • Revision ID: ed@carob-20120903135038-4a6my5u2ashdemga
[r=julian-edwards][bug=1044203][author=jtv] Stop updating DNS zone files when there are no new DHCP leases.

As discussed with Gavin, only additions really matter.  If there are none of those, there's no need to rewrite zone files.  Disappearing leases need no immediate DNS updates (and see bug 1045277).

The “post_updates” signal was a bit generic to skip in its entirety with such intricate justification, but this was its only use and it only had one handler.  After deliberation with Raphaël I replaced it with a conventional function call so that the action I'm skipping is clear and explicit in the calling code.

Also after deliberation with Raphaël, I restricted the zone-file update to the nodegroup that has changed.  We don't need to rewrite all DNS zones just because one had a change.

Show diffs side-by-side

added added

removed removed

Lines of Context:
141
141
    ip_range_high = IPAddressField(
142
142
        editable=True, unique=True, blank=True, null=True, default='')
143
143
 
 
144
    def __repr__(self):
 
145
        return "<NodeGroup %r>" % self.name
 
146
 
144
147
    def set_up_dhcp(self):
145
148
        """Write the DHCP configuration file and restart the DHCP server."""
146
149
        # Circular imports.