From d5da3d1f3ddb67ee3b35702b9249d7e4278801ec Mon Sep 17 00:00:00 2001 From: Thorsten Date: Thu, 11 Oct 2018 18:51:14 +0200 Subject: [PATCH] fix DSA comparison --- distbot/plugins/feeds.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/distbot/plugins/feeds.py b/distbot/plugins/feeds.py index e203784..d4cc97e 100644 --- a/distbot/plugins/feeds.py +++ b/distbot/plugins/feeds.py @@ -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) -- 2.39.2