mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-23 11:53:12 +00:00
Proprifie les enregistrement DNS (espacements constants)
This commit is contained in:
parent
fb035adc8a
commit
6191d558c1
1 changed files with 6 additions and 6 deletions
|
@ -295,7 +295,7 @@ class SOA(models.Model):
|
|||
def dns_soa_mail(self):
|
||||
""" Renvoie le mail dans l'enregistrement SOA """
|
||||
mail_fields = str(self.mail).split('@')
|
||||
return mail_fields[0].replace('.', '\\.') + '.' +mail_fields[1]
|
||||
return mail_fields[0].replace('.', '\\.') + '.' + mail_fields[1] + '.'
|
||||
|
||||
@classmethod
|
||||
def new_default_soa(cls):
|
||||
|
@ -361,7 +361,7 @@ class Mx(models.Model):
|
|||
def dns_entry(self):
|
||||
"""Renvoie l'entrée DNS complète pour un MX à mettre dans les
|
||||
fichiers de zones"""
|
||||
return "@ IN MX " + str(self.priority) + " " + str(self.name)
|
||||
return "@ IN MX " + str(self.priority).ljust(3) + " " + str(self.name)
|
||||
|
||||
def __str__(self):
|
||||
return str(self.zone) + ' ' + str(self.priority) + ' ' + str(self.name)
|
||||
|
@ -398,7 +398,7 @@ class Text(models.Model):
|
|||
@cached_property
|
||||
def dns_entry(self):
|
||||
"""Renvoie l'enregistrement TXT complet pour le fichier de zone"""
|
||||
return str(self.field1) + " IN TXT " + str(self.field2)
|
||||
return str(self.field1).ljust(15) + " IN TXT " + str(self.field2)
|
||||
|
||||
|
||||
class Interface(models.Model):
|
||||
|
|
Loading…
Reference in a new issue