VR CsGuestNetwork obey useextdns

This commit is contained in:
Ronald van Zantvoort 2016-05-13 17:18:01 +02:00 committed by Wido den Hollander
parent ed820bebe5
commit 2790d7a69b

View File

@ -38,13 +38,15 @@ class CsGuestNetwork:
def get_dns(self):
if not self.guest:
return self.config.get_dns()
# Can a router provide dhcp but not dns?
if 'dns' in self.data and 'router_guest_gateway' in self.data:
return [self.data['router_guest_gateway']] + self.data['dns'].split(',')
elif "router_guest_gateway" in self.data:
return [self.data['router_guest_gateway']]
else:
return [""]
dns = []
if not self.config.use_extdns() and 'router_guest_gateway' in self.data:
dns.append(self.data['router_guest_gateway'])
if 'dns' in self.data:
dns.extend(self.data['dns'].split(','))
return dns or ['']
def set_dns(self, val):
self.data['dns'] = val