On Thu, 2012-09-06 at 11:42 -0400, Rob Crittenden wrote:
> Martin Kosek wrote:
> > On 08/24/2012 07:54 PM, Rob Crittenden wrote:
> >> We weren't automatically creating the mail attribute despite having the 
> >> default
> >> e-mail domain. This patch will add it to all new users.
> >>
> >> To disable creating this set the default e-mail domain to empty in ipa 
> >> config.
> >>
> >> rob
> >>
> >
> > 1) Patch needs a rebase
> >
> > 2) There are 2 test cases where new default mail attribute was not added:
> >
> > ======================================================================
> > FAIL: test_user[34]: user_find: Search for "tuser2" with manager "tuser1"
> > ----------------------------------------------------------------------
> > ...
> >    extra keys = ['mail']
> > ...
> >
> > ======================================================================
> > FAIL: test_user[75]: user_add: Create 2nd admin user "admin2"
> > ----------------------------------------------------------------------
> > ...
> >    extra keys = ['mail']
> > ...
> >
> > 3) Some code could be simplified:
> >
> > This:
> > +        if 'ipadefaultemaildomain' in config:
> > +            defaultdomain = config['ipadefaultemaildomain'][0]
> > +        else:
> > +            defaultdomain = None
> >
> > To this:
> >               defaultdomain = config.get('ipadefaultemaildomain', [None])[0]
> >
> >
> > This:
> > if m.find('@') == -1 ...
> >
> > To this:
> > if '@' not in m ...
> >
> > IMHO, it is more readable than the find method.
> >
> > 3) When default e-mail domain is removed from config, users cannot be added 
> > any
> > more when e-mail is not explicitly specified:
> >
> > # ipa config-mod --emaildomain=
> >    Maximum username length: 32
> >    Home directory base: /home
> >    Default shell: /bin/sh
> >    Default users group: ipausers
> >    Search time limit: 2
> >    Search size limit: 100
> >    User search fields: uid,givenname,sn,telephonenumber,ou,title
> >    Group search fields: cn,description
> >    Enable migration mode: FALSE
> >    Certificate Subject base: O=IDM.LAB.BOS.REDHAT.COM
> >    Password Expiration Notification (days): 4
> >    Password plugin features: AllowNThash
> >    SELinux user map order:
> > guest_u:s0$xguest_u:s0$user_u:s0-s0:c0.c1023$staff_u:s0-s0:c0.c1023$unconfined_u:s0-s0:c0.c1023
> >    Default SELinux user: guest_u:s0
> >    PAC type: MS-PAC
> >
> > # ipa user-add --first=Foo --last=Bar fbar
> > ipa: ERROR: invalid 'email': invalid e-mail format: fbar
> >
> > Martin
> >
> 
> Rebased, issues addressed.
> 
> rob

Yup, its OK now.

ACK. I just had to squash an attached one-liner which updates range
tests I committed yesterday.

Pushed to master, ipa-3-0.

Martin
>From 91640237bb6b12dce5016f427bec4981bce24de4 Mon Sep 17 00:00:00 2001
From: Martin Kosek <mko...@redhat.com>
Date: Fri, 7 Sep 2012 13:34:42 +0200
Subject: [PATCH] Add missing mail attribute to range tests

---
 tests/test_xmlrpc/test_range_plugin.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/test_xmlrpc/test_range_plugin.py b/tests/test_xmlrpc/test_range_plugin.py
index 4b7aa0893b9c77ebdec38e518bcf63ef88a6ce09..d7d4dac0fe398d56de33a215d5f6f7bc0ed61129 100644
--- a/tests/test_xmlrpc/test_range_plugin.py
+++ b/tests/test_xmlrpc/test_range_plugin.py
@@ -109,6 +109,7 @@ class test_range(Declarative):
                     displayname=[u'Test User1'],
                     cn=[u'Test User1'],
                     initials=[u'TU'],
+                    mail=[u'%s@%s' % (user1, api.env.domain)],
                     ipauniqueid=[fuzzy_uuid],
                     krbpwdpolicyreference=[DN(('cn','global_policy'),('cn',api.env.realm),
                                               ('cn','kerberos'),api.env.basedn)],
-- 
1.7.11.4

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

Reply via email to