[elbe-devel] [PATCH v2 2/3] db: Get rid of jessie workaround

Bastian Germann bage at linutronix.de
Fri May 13 21:39:01 CEST 2022


jessie is not supported as initvm anymore, so drop workaroundis for
renamed function/member names.

Signed-off-by: Bastian Germann <bage at linutronix.de>
---
 elbepack/db.py      | 12 ++----------
 elbepack/virtapt.py |  9 ++-------
 2 files changed, 4 insertions(+), 17 deletions(-)

diff --git a/elbepack/db.py b/elbepack/db.py
index f9b0cd40a2..f5e7188774 100644
--- a/elbepack/db.py
+++ b/elbepack/db.py
@@ -894,11 +894,7 @@ class ElbeDB:
 
         # pylint: disable=too-many-arguments
 
-        # encrypt is deprecated but hash is not available in jessie
-        try:
-            pwhash = pbkdf2_sha512.hash(password)
-        except AttributeError:
-            pwhash = pbkdf2_sha512.encrypt(password)
+        pwhash = pbkdf2_sha512.hash(password)
 
         u = User(name=name,
                  fullname=fullname,
@@ -936,11 +932,7 @@ class ElbeDB:
 
             # Update password only if given
             if password is not None:
-                # encrypt is deprecated but hash is not available in jessie
-                try:
-                    u.pwhash = pbkdf2_sha512.hash(password)
-                except AttributeError:
-                    u.pwhash = pbkdf2_sha512.encrypt(password)
+                u.pwhash = pbkdf2_sha512.hash(password)
 
     def del_user(self, userid):
         with session_scope(self.session) as s:
diff --git a/elbepack/virtapt.py b/elbepack/virtapt.py
index 24d989cf96..77722f074f 100644
--- a/elbepack/virtapt.py
+++ b/elbepack/virtapt.py
@@ -59,13 +59,8 @@ def lookup_uri(v, d, target_pkg):
     if not x.is_trusted:
         return target_pkg, uri, ""
 
-    try:
-        # pylint: disable=no-member
-        hashval = str(r.hashes.find('SHA256')).split(':')[1]
-    except AttributeError:
-        # TODO: this fallback Code can be removed on stretch
-        #       but it throws DeprecationWarning already
-        hashval = r.sha256_hash
+    # pylint: disable=no-member
+    hashval = str(r.hashes.find('SHA256')).split(':')[1]
 
     return target_pkg, uri, hashval
 
-- 
2.30.2



More information about the elbe-devel mailing list