Ansgar pushed to branch deploy at Debian FTP Team / dak
Commits:
-
36debf67
by Ansgar at 2020-11-01T10:36:27+01:00
-
a2b954e8
by Ansgar at 2020-11-01T10:41:32+01:00
-
c593f75d
by Ansgar at 2020-11-01T10:44:50+01:00
3 changed files:
Changes:
... | ... | @@ -237,11 +237,11 @@ def list_uploads(filelist, rrd_dir): |
237 | 237 |
Delayed-Until: %s
|
238 | 238 |
Delay-Remaining: %s
|
239 | 239 |
Fingerprint: %s""" % (time.strftime("%Y-%m-%d %H:%M:%S", time.gmtime(time.time() + u[0])), u[2], u[5])
|
240 |
- fields = fields.encode('utf-8')
|
|
240 |
+ fields = six.ensure_str(fields)
|
|
241 | 241 |
print(fields, file=f)
|
242 |
- encoded = six.text_type(u[6]).encode('utf-8')
|
|
242 |
+ encoded = six.ensure_str(u[6].dump())
|
|
243 | 243 |
print(encoded.rstrip(), file=f)
|
244 |
- open(os.path.join(Cnf["Show-Deferred::LinkPath"], u[1]), "wb").write(encoded + fields + b'\n')
|
|
244 |
+ open(os.path.join(Cnf["Show-Deferred::LinkPath"], u[1]), "w").write(encoded + fields + '\n')
|
|
245 | 245 |
print(file=f)
|
246 | 246 |
f.close()
|
247 | 247 |
os.rename(os.path.join(Cnf["Show-Deferred::LinkPath"], '.status.tmp'),
|
... | ... | @@ -919,6 +919,7 @@ class Keyring(object): |
919 | 919 |
|
920 | 920 |
def import_users_from_ldap(self, session):
|
921 | 921 |
from .utils import open_ldap_connection
|
922 |
+ import ldap
|
|
922 | 923 |
l = open_ldap_connection()
|
923 | 924 |
cnf = Config()
|
924 | 925 |
LDAPDn = cnf["Import-LDAP-Fingerprints::LDAPDn"]
|
... | ... | @@ -797,6 +797,7 @@ def open_ldap_connection(): |
797 | 797 |
|
798 | 798 |
def get_logins_from_ldap(fingerprint='*'):
|
799 | 799 |
"""retrieve login from LDAP linked to a given fingerprint"""
|
800 |
+ import ldap
|
|
800 | 801 |
l = open_ldap_connection()
|
801 | 802 |
LDAPDn = Cnf["Import-LDAP-Fingerprints::LDAPDn"]
|
802 | 803 |
Attrs = l.search_s(LDAPDn, ldap.SCOPE_ONELEVEL,
|
... | ... | @@ -814,6 +815,7 @@ def get_logins_from_ldap(fingerprint='*'): |
814 | 815 |
|
815 | 816 |
def get_users_from_ldap():
|
816 | 817 |
"""retrieve login and user names from LDAP"""
|
818 |
+ import ldap
|
|
817 | 819 |
l = open_ldap_connection()
|
818 | 820 |
LDAPDn = Cnf["Import-LDAP-Fingerprints::LDAPDn"]
|
819 | 821 |
Attrs = l.search_s(LDAPDn, ldap.SCOPE_ONELEVEL,
|