Commit f3a566cf by Őry Máté

firewall: refactor host fqdn

refs #28
parent bc3656cb
......@@ -360,7 +360,7 @@ def dns():
for i_host in i_vlan.host_set.all():
ipv4 = ( i_host.pub_ipv4 if i_host.pub_ipv4 and not i_host.shared_ip else i_host.ipv4 )
reverse = i_host.reverse if(i_host.reverse and len(i_host.reverse)) else i_host.hostname + u'.' + i_vlan.domain
hostname = i_host.hostname + u'.' + i_vlan.domain
hostname = i_host.get_fqdn()
# ipv4
if i_host.ipv4:
......
......@@ -179,6 +179,10 @@ class Host(models.Model):
def del_rules(self):
self.rules.filter(owner=self.owner).delete()
def get_fqdn(self):
return self.hostname + u'.' + self.vlan.domain
class Firewall(models.Model):
name = models.CharField(max_length=20, unique=True)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment