]> git.aero2k.de Git - urlbot-v3.git/commitdiff
fix DSA comparison
authorThorsten <mail@aero2k.de>
Thu, 11 Oct 2018 16:51:14 +0000 (18:51 +0200)
committerThorsten <mail@aero2k.de>
Thu, 11 Oct 2018 16:51:14 +0000 (18:51 +0200)
distbot/plugins/feeds.py

index e2037842625187eec5d5c5305f86d6e6efca96d1..d4cc97e9a714c6dee1f3b45d4b17076fc1c86e02 100644 (file)
@@ -30,7 +30,10 @@ class DSAWatcher(Worker):
 
     @staticmethod
     def get_id_from_about_string(about):
-        return int(about.split('/')[-1].split('-')[1])
+        """
+        returns something like DSA-1232-1
+        """
+        return about.split('/')[-1].upper()
 
     def get_dsa_list(self, after_dsa_id, since):
         """
@@ -65,10 +68,9 @@ class DSAWatcher(Worker):
         out = []
         last_dsa = conf_get('plugins.dsa-watcher.last_dsa')
         # configobj, why u no work?
-        if last_dsa and last_dsa != "None":
-            last_dsa = int(last_dsa)
-        else:
-            last_dsa = 0
+        if not (last_dsa and last_dsa != "None"):
+            # as we do string comparison for DSA IDs, this will do fine
+            last_dsa = ""
         last_dsa_date = conf_get('plugins.dsa-watcher.last_dsa_date')
 
         if last_dsa_date:
@@ -79,7 +81,7 @@ class DSAWatcher(Worker):
 
         logger.debug('Searching for DSA after {}'.format(since))
         for dsa, date, package in self.get_dsa_list(after_dsa_id=last_dsa, since=since):
-            url = 'https://security-tracker.debian.org/tracker/DSA-%d-1' % dsa
+            url = 'https://security-tracker.debian.org/tracker/{}'.format(dsa)
 
             msg = '[{}] new Debian Security Announce found ({}): {}'.format(date, package, url)
             out.append(msg)