From: Mukund Sivaraman Date: Mon, 3 Dec 2012 05:21:18 +0000 (+0530) Subject: [2497] Make new_rdata_factory_users[] a list of tuples X-Git-Tag: bind10-1.0.0-beta-release~60 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=292db149be50cc3a38965be1e14ca1cf26cba2bb;p=thirdparty%2Fkea.git [2497] Make new_rdata_factory_users[] a list of tuples Also: * document new_rdata_factory_users[] with an example * Rename new_rdatafactory_users[] to new_rdata_factory_users[] --- diff --git a/src/lib/dns/gen-rdatacode.py.in b/src/lib/dns/gen-rdatacode.py.in index 9f2258206a..a5f62776fe 100755 --- a/src/lib/dns/gen-rdatacode.py.in +++ b/src/lib/dns/gen-rdatacode.py.in @@ -24,11 +24,20 @@ from os.path import getmtime import re import sys +# new_rdata_factory_users[] is a list of tuples of the form (rrtype, +# rrclass). Items in the list use the (new) RdataFactory class, and +# items which are not in the list use OldRdataFactory class. +# Note: rrtype and rrclass must be specified in lowercase in +# new_rdata_factory_users. +# +# Example: +# new_rdata_factory_users = [('a', 'in'), ('a', 'ch')] +new_rdata_factory_users = [] + re_typecode = re.compile('([\da-z]+)_(\d+)') classcode2txt = {} typecode2txt = {} typeandclass = [] -new_rdatafactory_users = [] generic_code = 65536 # something larger than any code value rdata_declarations = '' class_definitions = '' @@ -275,8 +284,8 @@ def generate_rrparam(fileprefix, basemtime): # By default, we use OldRdataFactory (see bug #2497). If you # want to pick RdataFactory for a particular type, add it to - # new_rdatafactory_users. - if type_txt in new_rdatafactory_users: + # new_rdata_factory_users. + if (type_txt.lower(), class_txt.lower()) in new_rdata_factory_users: rdf_class = 'RdataFactory' else: rdf_class = 'OldRdataFactory'