Add data field for A6 record

Since A6 is an obsolete RR type, no DNS part option was created.
This is, however, not consistent with the rest of per-type API
and may cause problems. This patch adds at least a DNS part for
raw A6 record data so that the record type is treated consistently.

This patch also fixes interactive mode for A6 records. Their data
were not detected correctly as dnsrecord_add didn't expect
a number in DNS part option name.

https://fedorahosted.org/freeipa/ticket/2309
This commit is contained in:
Martin Kosek
2012-02-03 14:52:34 +01:00
parent e1fecfaf6a
commit f411ed1e47
3 changed files with 17 additions and 6 deletions

View File

@@ -466,7 +466,15 @@ class ARecord(DNSRecord):
class A6Record(DNSRecord):
rrtype = 'A6'
rfc = 3226
parts = None # experimental rr type
parts = (
Str('data',
label=_('Record data'),
),
)
def _get_part_values(self, value):
# A6 RR type is obsolete and only a raw interface is provided
return (value,)
class AAAARecord(DNSRecord):
rrtype = 'AAAA'
@@ -1639,7 +1647,7 @@ class dnsrecord_add(LDAPCreate):
# check if any record part was added
for option in options:
option_part_re = re.match(r'([a-z]+)_part_', option)
option_part_re = re.match(r'([a-z0-9]+)_part_', option)
if option_part_re is not None:
record_option = self.obj.get_record_option(option_part_re.group(1))