[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[Git][ftp-team/dak][deploy] 3 commits: show-deferred: write everything as text, not binary data



Title: GitLab

Ansgar pushed to branch deploy at Debian FTP Team / dak

Commits:

3 changed files:

Changes:

  • dak/show_deferred.py
    ... ... @@ -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'),
    

  • daklib/dbconn.py
    ... ... @@ -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"]
    

  • daklib/utils.py
    ... ... @@ -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,
    


  • Reply to: