[Freeipa-devel] [PATCH] [WIP] 172+173 Create per-type DNS API

Martin Kosek mkosek at redhat.com
Wed Dec 14 07:02:29 UTC 2011


On Fri, 2011-12-09 at 01:02 -0600, Endi Sukma Dewata wrote:
> On 11/28/2011 10:35 AM, Martin Kosek wrote:

> > 1) The commands return a list of structured records (just like *-find
> > commands) instead of returning just one record. I thought that it may be
> > more usable this way and consistent with dnsrecord-add/mod/show commands
> > behavior which returns all records too. Otherwise, we would have to
> > change the show command API and add VALUE argument, which would specify
> > a value to be displayed:
> > dnsrecord<RRTYPE>-show ZONE NAME VALUE
> 
> I think for consistency it would be better to call this command 
> dnsrecord<RRTYPE>-find since it returns multiple entries. We might also 
> be able to add filters in the future.

We may do that but I would be cautious with filters - we cannot use
standard LDAP filters since the structured DNS records are constructed
in the framework, LDAP stores just raw values.

If we go with find, it would have this syntax:

dnsrecord<RRTYPE>-find ZONE NAME

> 
> > 2) Raw DNS record value is in the output too. I though it would be
> > useful to see the raw DNS record value + its parts at one place.
> 
> Yes, the raw value will be needed for calling dnsrecord<RRTYPE>-mod or 
> dnsrecord-del command.

Ok, I will leave it here then. I may rename it from <RRTYPE>record
parameter to name common for all structured commands - "data" for
example. Use may be able to make difference between structured DNS
name:value pairs and the raw value. It may look like this:

# ipa dnsrecordmx-show example.com @
  Raw DNS data: 0 server1.example.com
  Preference: 0
  Exchanger: server1.example.com

# ipa dnsrecordns-show example.com @
  Raw DNS data: vm-068.idm.lab.bos.redhat.com.
  Hostname: vm-068.idm.lab.bos.redhat.com.


> 
> > 3) The commands are in format dnsrecord<RRTYPE>-cmd, for example
> > dnsrecordmx-add. I think dnsrecord-mx-add may be more readable. If we
> > want to go this way, I would have to bend the server framework a little
> > which parses an LDAP object from the command name (LDAP object name is
> > dnsrecordmx in this case). This is doable, although I am not sure if
> > this does not have some implications in WebUI side.
> 
> I agree, the extra dash would be better. When calling a command the UI 
> concatenates entity name and method name with an '_'. In this case the 
> entity name will remain dnsrecord and the RRTYPE will be prepended to 
> the method name.

I agree, I will add the dash.

> 
> Btw, patch #175 causes a build break:
> 
> ipalib/parameters.py:718: [E1101, Param.normalize] Generator 
> '__unicode_csv_reader' has no 'next' member
> 

This will be fixed. It seems that I had an older pylint version which
didn't detect this false positive.

Martin




More information about the Freeipa-devel mailing list