コード例 #1
0
ファイル: models.py プロジェクト: ngokevin/cyder
def boot_strap_ipv6_reverse_domain(ip, soa=None):
    """
    This function is here to help create IPv6 reverse domains.

    .. note::
        Every nibble in the reverse domain should not exists for this
        function to exit successfully.


    :param ip: The ip address in nibble format
    :type ip: str
    :raises: ReverseDomainNotFoundError
    """
    validate_reverse_name(ip, '6')

    for i in range(1,len(ip)+1,2):
        cur_reverse_domain = ip[:i]
        reverse_domain = ReverseDomain(name = cur_reverse_domain, ip_type='6')
        reverse_domain.soa = soa
        reverse_domain.save()
    return reverse_domain
コード例 #2
0
def boot_strap_ipv6_reverse_domain(ip, soa=None):
    """
    This function is here to help create IPv6 reverse domains.

    .. note::
        Every nibble in the reverse domain should not exists for this
        function to exit successfully.


    :param ip: The ip address in nibble format
    :type ip: str
    :raises: ReverseDomainNotFoundError
    """
    validate_reverse_name(ip, '6')

    for i in xrange(1, len(ip) + 1, 2):
        cur_reverse_domain = ip[:i]
        domain_name = ip_to_domain_name(cur_reverse_domain, ip_type='6')
        reverse_domain = Domain(name=domain_name)
        reverse_domain.soa = soa
        reverse_domain.save()
    return reverse_domain
コード例 #3
0
ファイル: models.py プロジェクト: ngokevin/cyder
 def clean(self):
     validate_reverse_name(self.name, self.ip_type)
     self.name = self.name.lower()
     self.master_reverse_domain = _name_to_master_reverse_domain(self.name,
                                                     ip_type=self.ip_type)
     do_zone_validation(self)