Beispiel #1
0
 def deexpress(self, address=None):
     # if this is the last address, stop dns
     super(DHCPNetwork, self).deexpress(address=address)
     if len(self.assigned) == 0:
         linux_net.stop_dnsmasq(self)
     else:
         linux_net.start_dnsmasq(self)
Beispiel #2
0
 def express(self, address=None):
     super(DHCPNetwork, self).express(address=address)
     if len(self.assigned) > 0:
         logging.debug("Starting dnsmasq server for network with vlan %s",
                         self['vlan'])
         linux_net.start_dnsmasq(self)
     else:
         logging.debug("Not launching dnsmasq: no hosts.")
     self.express_cloudpipe()