Re: [Freeipa-devel] [PATCH] 23 Add ability to specify DNS reverse zone name by IP network address

2011-07-15 Thread Rob Crittenden

Jan Cholasta wrote:

On 28.6.2011 20:08, Rob Crittenden wrote:

Jan Cholasta wrote:

On 21.6.2011 14:15, Jan Cholasta wrote:

This patch adds a new option name_from_ip to dnszone commands. Default
value of idnsname is created from this option.

Honza



Fixed the API version number, added usage example to dns plugin help.

https://fedorahosted.org/freeipa/ticket/1045

Honza


Had quickie code review in IRC this morning. I asked for a comment
around the while loop, Honza suggested: This is to make chained
default_from work - idnssoarname default is created from idnsname and
idnsname default is created from name_from_ip - without this change,
idnssoarname default value isn't created when only name_from_ip is
specified.

Would also be nice to have a test case for this new usage.

rob


Added the test case.

The original ticket is now for the UI part, new ticket was opened for
the server-side part:

https://fedorahosted.org/freeipa/ticket/1474

Honza



pushed to master

___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel


Re: [Freeipa-devel] [PATCH] 23 Add ability to specify DNS reverse zone name by IP network address

2011-07-14 Thread Jan Cholasta

On 28.6.2011 20:08, Rob Crittenden wrote:

Jan Cholasta wrote:

On 21.6.2011 14:15, Jan Cholasta wrote:

This patch adds a new option name_from_ip to dnszone commands. Default
value of idnsname is created from this option.

Honza



Fixed the API version number, added usage example to dns plugin help.

https://fedorahosted.org/freeipa/ticket/1045

Honza


Had quickie code review in IRC this morning. I asked for a comment
around the while loop, Honza suggested: This is to make chained
default_from work - idnssoarname default is created from idnsname and
idnsname default is created from name_from_ip - without this change,
idnssoarname default value isn't created when only name_from_ip is
specified.

Would also be nice to have a test case for this new usage.

rob


Added the test case.

The original ticket is now for the UI part, new ticket was opened for 
the server-side part:


https://fedorahosted.org/freeipa/ticket/1474

Honza

--
Jan Cholasta
From 6daa2674216e01b4cd017a3a31ee72342c204cd9 Mon Sep 17 00:00:00 2001
From: Jan Cholasta jchol...@redhat.com
Date: Tue, 21 Jun 2011 14:07:19 +0200
Subject: [PATCH] Add ability to specify DNS reverse zone name by IP network
 address.

In order for this to work, chaining of parameters through
default_from is made possible.

ticket 1474
---
 API.txt|   23 +--
 VERSION|2 +-
 ipalib/frontend.py |6 +-
 ipalib/plugins/dns.py  |   30 ++
 tests/test_ipalib/test_frontend.py |   27 +++
 5 files changed, 76 insertions(+), 12 deletions(-)

diff --git a/API.txt b/API.txt
index 44292a9..827b44d 100644
--- a/API.txt
+++ b/API.txt
@@ -737,8 +737,9 @@ output: Output('summary', (type 'unicode', type 'NoneType'), 'User-friendly
 output: Entry('result', type 'dict', Gettext('A dictionary representing an LDAP entry', domain='ipa', localedir=None))
 output: Output('value', type 'unicode', The primary_key value of the entry, e.g. 'jdoe' for a user)
 command: dnszone_add
-args: 1,18,3
-arg: Str('idnsname', attribute=True, cli_name='name', label=Gettext('Zone name', domain='ipa', localedir=None), multivalue=False, normalizer=lambda, primary_key=True, required=True)
+args: 1,19,3
+arg: Str('idnsname', attribute=True, cli_name='name', default_from=DefaultFrom(lambda, 'name_from_ip'), label=Gettext('Zone name', domain='ipa', localedir=None), multivalue=False, normalizer=lambda, primary_key=True, required=True)
+option: Str('name_from_ip', _validate_ipnet, attribute=True, cli_name='name_from_ip', label=Gettext('Reverse zone IP network', domain='ipa', localedir=None), multivalue=False, required=False)
 option: Str('idnssoamname', attribute=True, cli_name='name_server', label=Gettext('Authoritative nameserver', domain='ipa', localedir=None), multivalue=False, required=True)
 option: Str('idnssoarname', attribute=True, cli_name='admin_email', default_from=DefaultFrom(lambda, 'idnsname'), label=Gettext('Administrator e-mail address', domain='ipa', localedir=None), multivalue=False, normalizer=_rname_normalizer, required=True)
 option: Int('idnssoaserial', attribute=True, autofill=True, cli_name='serial', create_default=_create_zone_serial, label=Gettext('SOA serial', domain='ipa', localedir=None), minvalue=1, multivalue=False, required=False)
@@ -762,27 +763,28 @@ output: Entry('result', type 'dict', Gettext('A dictionary representing an LDA
 output: Output('value', type 'unicode', The primary_key value of the entry, e.g. 'jdoe' for a user)
 command: dnszone_del
 args: 1,1,3
-arg: Str('idnsname', attribute=True, cli_name='name', label=Gettext('Zone name', domain='ipa', localedir=None), multivalue=True, normalizer=lambda, primary_key=True, query=True, required=True)
+arg: Str('idnsname', attribute=True, cli_name='name', default_from=DefaultFrom(lambda, 'name_from_ip'), label=Gettext('Zone name', domain='ipa', localedir=None), multivalue=True, normalizer=lambda, primary_key=True, query=True, required=True)
 option: Flag('continue', autofill=True, cli_name='continue', default=False)
 output: Output('summary', (type 'unicode', type 'NoneType'), 'User-friendly description of action performed')
 output: Output('result', type 'dict', 'list of deletions that failed')
 output: Output('value', type 'unicode', The primary_key value of the entry, e.g. 'jdoe' for a user)
 command: dnszone_disable
 args: 1,0,3
-arg: Str('idnsname', attribute=True, cli_name='name', label=Gettext('Zone name', domain='ipa', localedir=None), multivalue=False, normalizer=lambda, primary_key=True, query=True, required=True)
+arg: Str('idnsname', attribute=True, cli_name='name', default_from=DefaultFrom(lambda, 'name_from_ip'), label=Gettext('Zone name', domain='ipa', localedir=None), multivalue=False, normalizer=lambda, primary_key=True, query=True, required=True)
 output: Output('summary', (type 'unicode', type 'NoneType'), 'User-friendly description of action 

Re: [Freeipa-devel] [PATCH] 23 Add ability to specify DNS reverse zone name by IP network address

2011-07-01 Thread Jan Cholasta

On 30.6.2011 22:54, Adam Young wrote:

On 06/28/2011 02:08 PM, Rob Crittenden wrote:

Jan Cholasta wrote:

On 21.6.2011 14:15, Jan Cholasta wrote:

This patch adds a new option name_from_ip to dnszone commands. Default
value of idnsname is created from this option.

Honza



Fixed the API version number, added usage example to dns plugin help.

https://fedorahosted.org/freeipa/ticket/1045

Honza


Had quickie code review in IRC this morning. I asked for a comment
around the while loop, Honza suggested: This is to make chained
default_from work - idnssoarname default is created from idnsname and
idnsname default is created from name_from_ip - without this change,
idnssoarname default value isn't created when only name_from_ip is
specified.

Would also be nice to have a test case for this new usage.

rob

___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

NACK

Finally got the code to run, and I realize that it is completely a
client side operation. That won't work for the WebUI.


What do you mean? I have tested it both in CLI and WebUI and both worked 
fine.




The WebUI needs to use the same business logic as the CLI, but it cannot
execute client side Python. Thus the API needs to accept the IP address,
and calculate the reverse zone on it.


The API does accept the IP address (through the name_from_net option) 
and does calculate the reverse zone name from it.


I don't see where is the problem. Would you care to explain please?



The reverse zone should honor the netmask. A discussion earlier today
decided that if no netmask is specifified, use an assumed netmask of /64
for IPv6 and of /24 for IPv4.



Honza

--
Jan Cholasta

___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel


Re: [Freeipa-devel] [PATCH] 23 Add ability to specify DNS reverse zone name by IP network address

2011-06-30 Thread Adam Young

On 06/28/2011 02:08 PM, Rob Crittenden wrote:

Jan Cholasta wrote:

On 21.6.2011 14:15, Jan Cholasta wrote:

This patch adds a new option name_from_ip to dnszone commands. Default
value of idnsname is created from this option.

Honza



Fixed the API version number, added usage example to dns plugin help.

https://fedorahosted.org/freeipa/ticket/1045

Honza


Had quickie code review in IRC this morning. I asked for a comment 
around the while loop, Honza suggested: This is to make chained 
default_from work - idnssoarname default is created from idnsname and 
idnsname default is created from name_from_ip - without this change, 
idnssoarname default value isn't created when only name_from_ip is 
specified.


Would also be nice to have a test case for this new usage.

rob

___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

NACK

Finally got the code to run, and I realize that it is completely a 
client side operation.  That won't work for the WebUI.


The WebUI needs to use the same business logic as the CLI, but it cannot 
execute client side Python.  Thus the API needs to accept the IP 
address, and calculate the reverse zone on it.


The reverse zone should honor the netmask.  A discussion earlier today 
decided that if no netmask is specifified, use an assumed netmask of 
/64  for IPv6 and of /24 for IPv4.


___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel


Re: [Freeipa-devel] [PATCH] 23 Add ability to specify DNS reverse zone name by IP network address

2011-06-28 Thread Rob Crittenden

Jan Cholasta wrote:

On 21.6.2011 14:15, Jan Cholasta wrote:

This patch adds a new option name_from_ip to dnszone commands. Default
value of idnsname is created from this option.

Honza



Fixed the API version number, added usage example to dns plugin help.

https://fedorahosted.org/freeipa/ticket/1045

Honza


Had quickie code review in IRC this morning. I asked for a comment 
around the while loop, Honza suggested: This is to make chained 
default_from work - idnssoarname default is created from idnsname and 
idnsname default is created from name_from_ip - without this change, 
idnssoarname default value isn't created when only name_from_ip is 
specified.


Would also be nice to have a test case for this new usage.

rob

___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel


Re: [Freeipa-devel] [PATCH] 23 Add ability to specify DNS reverse zone name by IP network address

2011-06-23 Thread Jan Cholasta

On 21.6.2011 14:15, Jan Cholasta wrote:

This patch adds a new option name_from_ip to dnszone commands. Default
value of idnsname is created from this option.

Honza



Fixed the API version number, added usage example to dns plugin help.

https://fedorahosted.org/freeipa/ticket/1045

Honza

--
Jan Cholasta
From f29355597584a099448dad52a183a9c299ca3ecd Mon Sep 17 00:00:00 2001
From: Jan Cholasta jchol...@redhat.com
Date: Tue, 21 Jun 2011 14:07:19 +0200
Subject: [PATCH] Add ability to specify DNS reverse zone name by IP network
 address.

ticket 1045
---
 API.txt   |   23 +--
 VERSION   |2 +-
 install/ui/dns.js |1 +
 ipalib/frontend.py|6 +-
 ipalib/plugins/dns.py |   30 ++
 5 files changed, 50 insertions(+), 12 deletions(-)

diff --git a/API.txt b/API.txt
index 2f8c1a9..20d92d3 100644
--- a/API.txt
+++ b/API.txt
@@ -693,8 +693,9 @@ output: Output('summary', (type 'unicode', type 'NoneType'), 'User-friendly
 output: Entry('result', type 'dict', Gettext('A dictionary representing an LDAP entry', domain='ipa', localedir=None))
 output: Output('value', type 'unicode', The primary_key value of the entry, e.g. 'jdoe' for a user)
 command: dnszone_add
-args: 1,18,3
-arg: Str('idnsname', attribute=True, cli_name='name', label=Gettext('Zone name', domain='ipa', localedir=None), multivalue=False, normalizer=lambda, primary_key=True, required=True)
+args: 1,19,3
+arg: Str('idnsname', attribute=True, cli_name='name', default_from=DefaultFrom(lambda, 'name_from_ip'), label=Gettext('Zone name', domain='ipa', localedir=None), multivalue=False, normalizer=lambda, primary_key=True, required=True)
+option: Str('name_from_ip', _validate_ipnet, attribute=True, cli_name='name_from_ip', label=Gettext('Reverse zone IP network', domain='ipa', localedir=None), multivalue=False, required=False)
 option: Str('idnssoamname', attribute=True, cli_name='name_server', label=Gettext('Authoritative nameserver', domain='ipa', localedir=None), multivalue=False, required=True)
 option: Str('idnssoarname', attribute=True, cli_name='admin_email', default_from=DefaultFrom(lambda, 'idnsname'), label=Gettext('Administrator e-mail address', domain='ipa', localedir=None), multivalue=False, normalizer=_rname_normalizer, required=True)
 option: Int('idnssoaserial', attribute=True, autofill=True, cli_name='serial', create_default=_create_zone_serial, label=Gettext('SOA serial', domain='ipa', localedir=None), minvalue=1, multivalue=False, required=False)
@@ -718,27 +719,28 @@ output: Entry('result', type 'dict', Gettext('A dictionary representing an LDA
 output: Output('value', type 'unicode', The primary_key value of the entry, e.g. 'jdoe' for a user)
 command: dnszone_del
 args: 1,1,3
-arg: Str('idnsname', attribute=True, cli_name='name', label=Gettext('Zone name', domain='ipa', localedir=None), multivalue=True, normalizer=lambda, primary_key=True, query=True, required=True)
+arg: Str('idnsname', attribute=True, cli_name='name', default_from=DefaultFrom(lambda, 'name_from_ip'), label=Gettext('Zone name', domain='ipa', localedir=None), multivalue=True, normalizer=lambda, primary_key=True, query=True, required=True)
 option: Flag('continue', autofill=True, cli_name='continue', default=False)
 output: Output('summary', (type 'unicode', type 'NoneType'), 'User-friendly description of action performed')
 output: Output('result', type 'dict', 'list of deletions that failed')
 output: Output('value', type 'unicode', The primary_key value of the entry, e.g. 'jdoe' for a user)
 command: dnszone_disable
 args: 1,0,3
-arg: Str('idnsname', attribute=True, cli_name='name', label=Gettext('Zone name', domain='ipa', localedir=None), multivalue=False, normalizer=lambda, primary_key=True, query=True, required=True)
+arg: Str('idnsname', attribute=True, cli_name='name', default_from=DefaultFrom(lambda, 'name_from_ip'), label=Gettext('Zone name', domain='ipa', localedir=None), multivalue=False, normalizer=lambda, primary_key=True, query=True, required=True)
 output: Output('summary', (type 'unicode', type 'NoneType'), 'User-friendly description of action performed')
 output: Output('result', type 'bool', 'True means the operation was successful')
 output: Output('value', type 'unicode', The primary_key value of the entry, e.g. 'jdoe' for a user)
 command: dnszone_enable
 args: 1,0,3
-arg: Str('idnsname', attribute=True, cli_name='name', label=Gettext('Zone name', domain='ipa', localedir=None), multivalue=False, normalizer=lambda, primary_key=True, query=True, required=True)
+arg: Str('idnsname', attribute=True, cli_name='name', default_from=DefaultFrom(lambda, 'name_from_ip'), label=Gettext('Zone name', domain='ipa', localedir=None), multivalue=False, normalizer=lambda, primary_key=True, query=True, required=True)
 output: Output('summary', (type 'unicode', type 'NoneType'), 'User-friendly description of action performed')
 output: Output('result', type 'bool', 'True means 

[Freeipa-devel] [PATCH] 23 Add ability to specify DNS reverse zone name by IP network address

2011-06-21 Thread Jan Cholasta
This patch adds a new option name_from_ip to dnszone commands. Default 
value of idnsname is created from this option.


Honza

--
Jan Cholasta
From d84375d986cf496337a31059c1dec8cf8b31fe59 Mon Sep 17 00:00:00 2001
From: Jan Cholasta jchol...@redhat.com
Date: Tue, 21 Jun 2011 14:07:19 +0200
Subject: [PATCH] Add ability to specify DNS reverse zone name by IP network
 address.

ticket 1045
---
 API.txt   |   23 +--
 VERSION   |2 +-
 install/ui/dns.js |1 +
 ipalib/frontend.py|6 +-
 ipalib/plugins/dns.py |   26 ++
 5 files changed, 46 insertions(+), 12 deletions(-)

diff --git a/API.txt b/API.txt
index 2f8c1a9..20d92d3 100644
--- a/API.txt
+++ b/API.txt
@@ -693,8 +693,9 @@ output: Output('summary', (type 'unicode', type 'NoneType'), 'User-friendly
 output: Entry('result', type 'dict', Gettext('A dictionary representing an LDAP entry', domain='ipa', localedir=None))
 output: Output('value', type 'unicode', The primary_key value of the entry, e.g. 'jdoe' for a user)
 command: dnszone_add
-args: 1,18,3
-arg: Str('idnsname', attribute=True, cli_name='name', label=Gettext('Zone name', domain='ipa', localedir=None), multivalue=False, normalizer=lambda, primary_key=True, required=True)
+args: 1,19,3
+arg: Str('idnsname', attribute=True, cli_name='name', default_from=DefaultFrom(lambda, 'name_from_ip'), label=Gettext('Zone name', domain='ipa', localedir=None), multivalue=False, normalizer=lambda, primary_key=True, required=True)
+option: Str('name_from_ip', _validate_ipnet, attribute=True, cli_name='name_from_ip', label=Gettext('Reverse zone IP network', domain='ipa', localedir=None), multivalue=False, required=False)
 option: Str('idnssoamname', attribute=True, cli_name='name_server', label=Gettext('Authoritative nameserver', domain='ipa', localedir=None), multivalue=False, required=True)
 option: Str('idnssoarname', attribute=True, cli_name='admin_email', default_from=DefaultFrom(lambda, 'idnsname'), label=Gettext('Administrator e-mail address', domain='ipa', localedir=None), multivalue=False, normalizer=_rname_normalizer, required=True)
 option: Int('idnssoaserial', attribute=True, autofill=True, cli_name='serial', create_default=_create_zone_serial, label=Gettext('SOA serial', domain='ipa', localedir=None), minvalue=1, multivalue=False, required=False)
@@ -718,27 +719,28 @@ output: Entry('result', type 'dict', Gettext('A dictionary representing an LDA
 output: Output('value', type 'unicode', The primary_key value of the entry, e.g. 'jdoe' for a user)
 command: dnszone_del
 args: 1,1,3
-arg: Str('idnsname', attribute=True, cli_name='name', label=Gettext('Zone name', domain='ipa', localedir=None), multivalue=True, normalizer=lambda, primary_key=True, query=True, required=True)
+arg: Str('idnsname', attribute=True, cli_name='name', default_from=DefaultFrom(lambda, 'name_from_ip'), label=Gettext('Zone name', domain='ipa', localedir=None), multivalue=True, normalizer=lambda, primary_key=True, query=True, required=True)
 option: Flag('continue', autofill=True, cli_name='continue', default=False)
 output: Output('summary', (type 'unicode', type 'NoneType'), 'User-friendly description of action performed')
 output: Output('result', type 'dict', 'list of deletions that failed')
 output: Output('value', type 'unicode', The primary_key value of the entry, e.g. 'jdoe' for a user)
 command: dnszone_disable
 args: 1,0,3
-arg: Str('idnsname', attribute=True, cli_name='name', label=Gettext('Zone name', domain='ipa', localedir=None), multivalue=False, normalizer=lambda, primary_key=True, query=True, required=True)
+arg: Str('idnsname', attribute=True, cli_name='name', default_from=DefaultFrom(lambda, 'name_from_ip'), label=Gettext('Zone name', domain='ipa', localedir=None), multivalue=False, normalizer=lambda, primary_key=True, query=True, required=True)
 output: Output('summary', (type 'unicode', type 'NoneType'), 'User-friendly description of action performed')
 output: Output('result', type 'bool', 'True means the operation was successful')
 output: Output('value', type 'unicode', The primary_key value of the entry, e.g. 'jdoe' for a user)
 command: dnszone_enable
 args: 1,0,3
-arg: Str('idnsname', attribute=True, cli_name='name', label=Gettext('Zone name', domain='ipa', localedir=None), multivalue=False, normalizer=lambda, primary_key=True, query=True, required=True)
+arg: Str('idnsname', attribute=True, cli_name='name', default_from=DefaultFrom(lambda, 'name_from_ip'), label=Gettext('Zone name', domain='ipa', localedir=None), multivalue=False, normalizer=lambda, primary_key=True, query=True, required=True)
 output: Output('summary', (type 'unicode', type 'NoneType'), 'User-friendly description of action performed')
 output: Output('result', type 'bool', 'True means the operation was successful')
 output: Output('value', type 'unicode', The primary_key value of the entry, e.g. 'jdoe' for a user)
 command: dnszone_find
-args: 1,18,4

Re: [Freeipa-devel] [PATCH] 23 Add ability to specify DNS reverse zone name by IP network address

2011-06-21 Thread Adam Young

On 06/21/2011 08:15 AM, Jan Cholasta wrote:
This patch adds a new option name_from_ip to dnszone commands. Default 
value of idnsname is created from this option.


Honza


___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Some questions:

Is the field name_from_ip conditional?  I assume that either we want to 
provide the name, or calculate the name from the IP address.


Should the field be a checkbox?

Will you code to calculate the reverse zone for an IPv6 Address work for 
the shorthand notation  like this?


feco::::

What is the point of the code
+while True:
+default = self.get_default(**params)
+if len(default) == 0:
+break
+params.update(default)

I am guessing that there is no risk of an infinite loop here.  Just 
seems like this code is meant to run for things other than dns.



___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Re: [Freeipa-devel] [PATCH] 23 Add ability to specify DNS reverse zone name by IP network address

2011-06-21 Thread Dmitri Pal
On 06/21/2011 08:15 AM, Jan Cholasta wrote:
 This patch adds a new option name_from_ip to dnszone commands. Default
 value of idnsname is created from this option.

 Honza


 ___
 Freeipa-devel mailing list
 Freeipa-devel@redhat.com
 https://www.redhat.com/mailman/listinfo/freeipa-devel
What ticket it is for?

-- 
Thank you,
Dmitri Pal

Sr. Engineering Manager IPA project,
Red Hat Inc.


---
Looking to carve out IT costs?
www.redhat.com/carveoutcosts/



___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Re: [Freeipa-devel] [PATCH] 23 Add ability to specify DNS reverse zone name by IP network address

2011-06-21 Thread Martin Kosek
On Tue, 2011-06-21 at 14:15 +0200, Jan Cholasta wrote:
 This patch adds a new option name_from_ip to dnszone commands. Default 
 value of idnsname is created from this option.
 
 Honza

One more comment - we don't want major API version change. This would
make existing v2 clients/server incompatible until both are updated.

In this case only a minor API version bump is needed as the API remains
backwards compatible with the old one.

Martin

___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel


Re: [Freeipa-devel] [PATCH] 23 Add ability to specify DNS reverse zone name by IP network address

2011-06-21 Thread Jan Cholasta

On 21.6.2011 16:00, Dmitri Pal wrote:

On 06/21/2011 08:15 AM, Jan Cholasta wrote:

This patch adds a new option name_from_ip to dnszone commands. Default
value of idnsname is created from this option.

Honza


___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

What ticket it is for?


https://fedorahosted.org/freeipa/ticket/1045



--
Thank you,
Dmitri Pal

Sr. Engineering Manager IPA project,
Red Hat Inc.


---
Looking to carve out IT costs?
www.redhat.com/carveoutcosts/




--
Jan Cholasta

___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel


Re: [Freeipa-devel] [PATCH] 23 Add ability to specify DNS reverse zone name by IP network address

2011-06-21 Thread Jan Cholasta

On 21.6.2011 16:20, Martin Kosek wrote:

On Tue, 2011-06-21 at 14:15 +0200, Jan Cholasta wrote:

This patch adds a new option name_from_ip to dnszone commands. Default
value of idnsname is created from this option.

Honza


One more comment - we don't want major API version change. This would
make existing v2 clients/server incompatible until both are updated.

In this case only a minor API version bump is needed as the API remains
backwards compatible with the old one.


OK.



Martin



Honza

--
Jan Cholasta

___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel


Re: [Freeipa-devel] [PATCH] 23 Add ability to specify DNS reverse zone name by IP network address

2011-06-21 Thread Jan Cholasta

On 21.6.2011 16:04, Adam Young wrote:

On 06/21/2011 08:15 AM, Jan Cholasta wrote:

This patch adds a new option name_from_ip to dnszone commands. Default
value of idnsname is created from this option.

Honza


___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Some questions:

Is the field name_from_ip conditional?  I assume that either we want to
provide the name, or calculate the name from the IP address.


If name_from_ip is used, the default value for idnsname is created from 
it. Thus, if both idnsname and name_from_ip are specified, idnsname has 
precedence.




Should the field be a checkbox?


Possibly. I'll leave that to you (and the rest of you UI developers) to 
decide.




Will you code to calculate the reverse zone for an IPv6 Address work for
the shorthand notation  like this?

feco::::


It is handled by python-netaddr, so yes.



What is the point of the code
+while True:
+default = self.get_default(**params)
+if len(default) == 0:
+break
+params.update(default)

I am guessing that there is no risk of an infinite loop here.  Just
seems like this code is meant to run for things other than dns.


This is to make chained default_from work - idnssoarname default is 
created from idnsname and idnsname default is created from name_from_ip 
- without this change, idnssoarname default value isn't created when 
only name_from_ip is specified.


Honza

--
Jan Cholasta

___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel