[Freeipa-devel] [PATCH] Add new version of DNS plugin: complete rework with baseldap + unit tests.

Adam Young ayoung at redhat.com
Thu Dec 2 02:37:10 UTC 2010


On 11/24/2010 02:28 PM, Pavel Zůna wrote:
> On 2010-11-24 16:21, Adam Young wrote:
>> On 11/24/2010 03:46 AM, Pavel Zuna wrote:
>>> On 11/24/2010 03:26 AM, Adam Young wrote:
>>>> On 11/23/2010 09:37 AM, Pavel Zuna wrote:
>>>>> Finally managed to rewrite the DNS plugin again. Sorry, it took so
>>>>> long, we had training in the office and I also had a nasty bug in
>>>>> baseldap.py I couldn't find.
>>>>>
>>>>> Anyway, this version has it all:
>>>>> - changes we agreed on meeting, the "resource" abstraction is gone 
>>>>> and
>>>>> we now only have zones and records = adding new record automatically
>>>>> updates and existing entry or creates it if it wasn't there and
>>>>> deleting the last record deletes the whole entry - all of it
>>>>> transparent to the user
>>>>> - unit tests
>>>>> - ipa help documentation
>>>>>
>>>>> Fixes tickets:
>>>>> #36
>>>>> #450
>>>>>
>>>>> I also closed bug #654412.
>>>>>
>>>>> It has a new patch sequence number, because it depends on another
>>>>> patch with a higher number and didn't want to create forward
>>>>> dependencies.
>>>>>
>>>>> Depends on my patches number:
>>>>> 35 (will repost if needed)
>>>>> 38 (posted a while ago on freeipa-devel)
>>>>>
>>>>> Pavel
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> Freeipa-devel mailing list
>>>>> Freeipa-devel at redhat.com
>>>>> https://www.redhat.com/mailman/listinfo/freeipa-devel
>>>>
>>>> I keep getting an error when doing simple things like install and ipa
>>>> help:
>>>> [ayoung at ipa freeipa]$ ./ipa help dns2
>>>> ipa: ERROR: AttributeError: cannot override NameSpace.idnsname value
>>>> Str('idnsname', cli_name='name', doc=Gettext('Zone name (FQDN)',
>>>> domain='ipa', localedir=None), label=Gettext('Zone name', 
>>>> domain='ipa',
>>>> localedir=None), multivalue=False, normalizer=<lambda>,
>>>> primary_key=True, query=True, required=True) with Str('idnsname',
>>>> attribute=True, cli_name='name', doc=Gettext('Record name',
>>>> domain='ipa', localedir=None), label=Gettext('Record name',
>>>> domain='ipa', localedir=None), multivalue=False, primary_key=True,
>>>> query=True, required=True)
>>>> Traceback (most recent call last):
>>>> File "/home/ayoung/devel/freeipa/ipalib/cli.py", line 962, in run
>>>> api.finalize()
>>>> File "/home/ayoung/devel/freeipa/ipalib/plugable.py", line 615, in
>>>> finalize
>>>> p.instance.finalize()
>>>> File "/home/ayoung/devel/freeipa/ipalib/frontend.py", line 724, in
>>>> finalize
>>>> self._create_param_namespace('args')
>>>> File "/home/ayoung/devel/freeipa/ipalib/frontend.py", line 350, in
>>>> _create_param_namespace
>>>> sort=False
>>>> File "/home/ayoung/devel/freeipa/ipalib/base.py", line 407, in 
>>>> __init__
>>>> (self.__class__.__name__, name, self.__map[name], member)
>>>> AttributeError: cannot override NameSpace.idnsname value 
>>>> Str('idnsname',
>>>> cli_name='name', doc=Gettext('Zone name (FQDN)', domain='ipa',
>>>> localedir=None), label=Gettext('Zone name', domain='ipa',
>>>> localedir=None), multivalue=False, normalizer=<lambda>,
>>>> primary_key=True, query=True, required=True) with Str('idnsname',
>>>> attribute=True, cli_name='name', doc=Gettext('Record name',
>>>> domain='ipa', localedir=None), label=Gettext('Record name',
>>>> domain='ipa', localedir=None), multivalue=False, primary_key=True,
>>>> query=True, required=True)
>>>> ipa: ERROR: an internal error has occurred
>>>>
>>>
>>> That's because you need my patch number 35 for it to work...
>>>
>>> Pavel
>>
>> OK, with that change, the patch applies and works.
>>
>> I've tested: creating a zone
>> Creating an a record
>> Adding an a record entry to an existing entry (calling ipa dnsrecord-add
>> a second time with just a different ip address)
>> Adding an aaaa record.
>> Deleting one and multiple aaaa records
>>
>>
>> One thing that is a little counter intuitive is that you have to specify
>> which records to delete: just running
>> ipa dnsrecord-del ayoung.test.ipa.redhat.com hiphop doesn't delete all
>> records with the A name of hiphop. I think this is the right behavior,
>> but it should be better documented.
>
> Ok, I'm going to add a few lines about it in the docstring (ipa help).
>
> Maybe we should have an option to delete all records associated with a 
> resource name. For example when someone is deleting a host from DNS 
> and wants all of its records gone.
>
>>
>> Have to hold off on pushing it due to F14: python-netaddr Isn't in F14,
>> so we are adding a new python package with this plugin, too.
>>
>>
>
> Pavel
ACK and pushed to master

Note that I got an OK on the added dependency on python-netaddr.




More information about the Freeipa-devel mailing list