[sysadmin-bin] More py3 compatibility changes
- From: Andrea Veri <averi src gnome org>
- To: gnome-sysadmin gnome org,commits-list gnome org
- Subject: [sysadmin-bin] More py3 compatibility changes
- Date: Thu, 12 Nov 2020 20:38:01 +0000 (UTC)
commit aef394969827b07cd05e4fad728e320a4224b527
Author: Andrea Veri <averi redhat com>
Date: Thu Nov 12 21:37:55 2020 +0100
More py3 compatibility changes
membership/foundation-operations.py | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/membership/foundation-operations.py b/membership/foundation-operations.py
index 52f0790..1ddbe01 100755
--- a/membership/foundation-operations.py
+++ b/membership/foundation-operations.py
@@ -57,7 +57,7 @@ except IOError as e:
glu = Glu.Gnome_ldap_utils(LDAP_GROUP_BASE, LDAP_HOST, LDAP_USER_BASE, LDAP_USER, LDAP_PASSWORD)
today = dt.date.today()
-foundationmembers = Glu.get_uids_from_group('foundation')
+foundationmembers = glu.get_uids_from_group('foundation')
def send_renewal_emails():
@@ -96,10 +96,10 @@ def remove_expired_memberships_from_foundation():
for member in foundationmembers:
ldap_fields = glu.get_attributes_from_ldap(member, 'LastRenewedOn', 'mail', 'cn')
- last_renewed_on_attr = ldap_fields[1]
+ last_renewed_on_attr = ldap_fields[1].decode('utf-8')
last_renewed_on = dt.date(int(last_renewed_on_attr.split('-')[0]),
int(last_renewed_on_attr.split('-')[1]), int(last_renewed_on_attr.split('-')[2]))
- mail_attr = ldap_fields[2]
- common_name_attr = ldap_fields[3]
+ mail_attr = ldap_fields[2].decode('utf-8')
+ common_name_attr = ldap_fields[3].decode('utf-8')
if today == (last_renewed_on + delta_2y - delta_1m):
send_form_letters(close_to_expire_membership_form_letter, mail_attr, common_name_attr,
last_renewed_on_attr)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]