Re: [Freeipa-devel] [PATCH] 908 make some fields required

2011-12-06 Thread Rob Crittenden

Rob Crittenden wrote:

Endi Sukma Dewata wrote:

On 11/28/2011 12:09 PM, Rob Crittenden wrote:

Some attributes in the framework were not marked as required even though
they are in the schema. These are typically computed values and I think
the intention was to not prompt for them. This has the side-effect of
them showing as not required in the UI even though they are.

Since they all have default values set they won't be prompted for on the
CLI so there won't be any practical changes.


This patch fixes the problem with required attributes in DNS Zones and
cn, uidNumber, and gidNumber in Users. The UI now shows the required
indicators for these attributes. So this patch is ACKed.

Some problems mentioned in ticket #2015 are still present:

1. Removing the homeDirectory from a user fails because it's required by
posixAccount.

2. Removing the gidNumber from a group fails because it's required by
posixGroup.

3. Removing config attributes listed in the ticket generates internal
error. I think at least the server should return a proper error message.
The required indicator can be hard-coded in the UI if necessary.



I know you acked this already but I went ahead and addressed #1 and #2
and updated the patch.

For #3 I filed a new ticket, https://fedorahosted.org/freeipa/ticket/2159

rob


ACKed by Endi in IRC, pushed to master.

rob

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


Re: [Freeipa-devel] [PATCH] 908 make some fields required

2011-12-02 Thread Rob Crittenden

Endi Sukma Dewata wrote:

On 11/28/2011 12:09 PM, Rob Crittenden wrote:

Some attributes in the framework were not marked as required even though
they are in the schema. These are typically computed values and I think
the intention was to not prompt for them. This has the side-effect of
them showing as not required in the UI even though they are.

Since they all have default values set they won't be prompted for on the
CLI so there won't be any practical changes.


This patch fixes the problem with required attributes in DNS Zones and
cn, uidNumber, and gidNumber in Users. The UI now shows the required
indicators for these attributes. So this patch is ACKed.

Some problems mentioned in ticket #2015 are still present:

1. Removing the homeDirectory from a user fails because it's required by
posixAccount.

2. Removing the gidNumber from a group fails because it's required by
posixGroup.

3. Removing config attributes listed in the ticket generates internal
error. I think at least the server should return a proper error message.
The required indicator can be hard-coded in the UI if necessary.



I know you acked this already but I went ahead and addressed #1 and #2 
and updated the patch.


For #3 I filed a new ticket, https://fedorahosted.org/freeipa/ticket/2159

rob
From 27feb376d5df5812abe35b7a903bd8c16cb25be3 Mon Sep 17 00:00:00 2001
From: Rob Crittenden rcrit...@redhat.com
Date: Mon, 28 Nov 2011 12:31:45 -0500
Subject: [PATCH] Mark some attributes required to match the schema.

This makes no changes to the functionality in the command-line or
GUI because these all have defaults anyway. This is mostly to show
them properly in the UI and prevent someone from trying to erase the
value (and getting a nasty schema error in response).

https://fedorahosted.org/freeipa/ticket/2015
---
 API.txt |   16 
 ipalib/plugins/dns.py   |   10 +-
 ipalib/plugins/group.py |   11 +++
 ipalib/plugins/user.py  |   12 +++-
 4 files changed, 31 insertions(+), 18 deletions(-)

diff --git a/API.txt b/API.txt
index d2a58a3..1863dc2 100644
--- a/API.txt
+++ b/API.txt
@@ -865,11 +865,11 @@ arg: Str('idnsname', attribute=True, cli_name='name', multivalue=False, primary_
 option: Str('name_from_ip', attribute=False, cli_name='name_from_ip', multivalue=False, required=False)
 option: Str('idnssoamname', attribute=True, cli_name='name_server', multivalue=False, required=True)
 option: Str('idnssoarname', attribute=True, cli_name='admin_email', multivalue=False, required=True)
-option: Int('idnssoaserial', attribute=True, autofill=True, cli_name='serial', minvalue=1, multivalue=False, required=False)
-option: Int('idnssoarefresh', attribute=True, autofill=True, cli_name='refresh', default=3600, minvalue=0, multivalue=False, required=False)
-option: Int('idnssoaretry', attribute=True, autofill=True, cli_name='retry', default=900, minvalue=0, multivalue=False, required=False)
-option: Int('idnssoaexpire', attribute=True, autofill=True, cli_name='expire', default=1209600, minvalue=0, multivalue=False, required=False)
-option: Int('idnssoaminimum', attribute=True, autofill=True, cli_name='minimum', default=3600, maxvalue=10800, minvalue=0, multivalue=False, required=False)
+option: Int('idnssoaserial', attribute=True, autofill=True, cli_name='serial', minvalue=1, multivalue=False, required=True)
+option: Int('idnssoarefresh', attribute=True, autofill=True, cli_name='refresh', default=3600, minvalue=0, multivalue=False, required=True)
+option: Int('idnssoaretry', attribute=True, autofill=True, cli_name='retry', default=900, minvalue=0, multivalue=False, required=True)
+option: Int('idnssoaexpire', attribute=True, autofill=True, cli_name='expire', default=1209600, minvalue=0, multivalue=False, required=True)
+option: Int('idnssoaminimum', attribute=True, autofill=True, cli_name='minimum', default=3600, maxvalue=10800, minvalue=0, multivalue=False, required=True)
 option: Int('dnsttl', attribute=True, cli_name='ttl', multivalue=False, required=False)
 option: StrEnum('dnsclass', attribute=True, cli_name='class', multivalue=False, required=False, values=(u'IN', u'CS', u'CH', u'HS'))
 option: Str('idnsupdatepolicy', attribute=True, cli_name='update_policy', multivalue=False, required=False)
@@ -2894,7 +2894,7 @@ args: 1,31,3
 arg: Str('uid', attribute=True, cli_name='login', maxlength=255, multivalue=False, pattern='^[a-zA-Z0-9_.][a-zA-Z0-9_.-]{0,252}[a-zA-Z0-9_.$-]?$', pattern_errmsg='may only include letters, numbers, _, -, . and $', primary_key=True, required=True)
 option: Str('givenname', attribute=True, cli_name='first', multivalue=False, required=True)
 option: Str('sn', attribute=True, cli_name='last', multivalue=False, required=True)
-option: Str('cn', attribute=True, autofill=True, cli_name='cn', multivalue=False, required=False)
+option: Str('cn', attribute=True, autofill=True, cli_name='cn', multivalue=False, required=True)
 option: Str('displayname', attribute=True, 

Re: [Freeipa-devel] [PATCH] 908 make some fields required

2011-11-29 Thread Rob Crittenden

Endi Sukma Dewata wrote:

On 11/28/2011 12:09 PM, Rob Crittenden wrote:

Some attributes in the framework were not marked as required even though
they are in the schema. These are typically computed values and I think
the intention was to not prompt for them. This has the side-effect of
them showing as not required in the UI even though they are.

Since they all have default values set they won't be prompted for on the
CLI so there won't be any practical changes.


This patch fixes the problem with required attributes in DNS Zones and
cn, uidNumber, and gidNumber in Users. The UI now shows the required
indicators for these attributes. So this patch is ACKed.

Some problems mentioned in ticket #2015 are still present:

1. Removing the homeDirectory from a user fails because it's required by
posixAccount.


Ok, I can probably fix this one.


2. Removing the gidNumber from a group fails because it's required by
posixGroup.


Well, its hard to make gidNumber required since you can have non-posix 
groups. I think we'll have to just live with this one.




3. Removing config attributes listed in the ticket generates internal
error. I think at least the server should return a proper error message.
The required indicator can be hard-coded in the UI if necessary.



The config problems are a separate issue. To make them required would 
mean that the user would need to provide a value with a -mod request.


rob

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


Re: [Freeipa-devel] [PATCH] 908 make some fields required

2011-11-28 Thread Endi Sukma Dewata

On 11/28/2011 12:09 PM, Rob Crittenden wrote:

Some attributes in the framework were not marked as required even though
they are in the schema. These are typically computed values and I think
the intention was to not prompt for them. This has the side-effect of
them showing as not required in the UI even though they are.

Since they all have default values set they won't be prompted for on the
CLI so there won't be any practical changes.


This patch fixes the problem with required attributes in DNS Zones and 
cn, uidNumber, and gidNumber in Users. The UI now shows the required 
indicators for these attributes. So this patch is ACKed.


Some problems mentioned in ticket #2015 are still present:

1. Removing the homeDirectory from a user fails because it's required by 
posixAccount.


2. Removing the gidNumber from a group fails because it's required by 
posixGroup.


3. Removing config attributes listed in the ticket generates internal 
error. I think at least the server should return a proper error message. 
The required indicator can be hard-coded in the UI if necessary.


--
Endi S. Dewata

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