From bf28d4c8d0f085329105a4232c1a2ff3d61f067f Mon Sep 17 00:00:00 2001 From: Rob Crittenden Date: Jun 10 2020 18:35:38 +0000 Subject: IPA-EPN: Don't treat givenname differently This was returning givenname as a list and not as a single string which messed up the templating. https://pagure.io/freeipa/issue/3687 Signed-off-by: Rob Crittenden Reviewed-By: Francois Cami --- diff --git a/ipaclient/install/ipa_epn.py b/ipaclient/install/ipa_epn.py index 3e27c19..6e1b001 100644 --- a/ipaclient/install/ipa_epn.py +++ b/ipaclient/install/ipa_epn.py @@ -133,7 +133,7 @@ class EPNUserList: dict( uid=str(entry["uid"].pop(0)), cn=str(entry["cn"].pop(0)), - givenname=str(entry.get("givenname", "")), + givenname=str(entry["givenname"].pop(0)), sn=str(entry["sn"].pop(0)), krbpasswordexpiration=str( entry["krbpasswordexpiration"].pop(0) @@ -438,7 +438,7 @@ class EPN(admintool.AdminTool): search_base = DN(api.env.container_user, api.env.basedn) attrs_list = ["uid", "krbpasswordexpiration", "mail", "cn", - "gn", "surname"] + "givenname", "surname"] search_filter = ( "(&(!(nsaccountlock=TRUE)) \ diff --git a/ipatests/test_integration/test_epn.py b/ipatests/test_integration/test_epn.py index 2e335ad..7f56d4b 100644 --- a/ipatests/test_integration/test_epn.py +++ b/ipatests/test_integration/test_epn.py @@ -373,7 +373,7 @@ class TestEPN(IntegrationTest): tasks.ipa_epn(self.master) for i in self.notify_ttls: validate_mail(self.master, i, - "Hi user,\nYour login entry user%d is going" % i) + "Hi test user,\nYour login entry user%d is going" % i) def test_mailtest(self, cleanupmail): """Execute mailtest to validate mail is working @@ -422,7 +422,7 @@ class TestEPN(IntegrationTest): tasks.ipa_epn(self.master) for i in self.notify_ttls: validate_mail(self.master, i, - "Hi user,\nYour login entry user%d is going" % i) + "Hi test user,\nYour login entry user%d is going" % i) def test_EPN_ssl(self, cleanupmail): """Configure with ssl and test delivery @@ -441,7 +441,7 @@ class TestEPN(IntegrationTest): tasks.ipa_epn(self.master) for i in self.notify_ttls: validate_mail(self.master, i, - "Hi user,\nYour login entry user%d is going" % i) + "Hi test user,\nYour login entry user%d is going" % i) def test_EPN_delay_config(self, cleanupmail): """Test the smtp_delay configuration option