From c4be56666215c3a4af181f79dddfd1eb8697c9f4 Mon Sep 17 00:00:00 2001 From: lilydjwg Date: Sun, 19 Oct 2014 16:11:57 +0800 Subject: [PATCH] fix notification message generation --- archrepo2/repomon.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/archrepo2/repomon.py b/archrepo2/repomon.py index f3f0dd7..0555a83 100755 --- a/archrepo2/repomon.py +++ b/archrepo2/repomon.py @@ -178,9 +178,10 @@ class RepoMan: def _new_notification_msg(self): s = 'update' t = str(int(time.time())) - part1 = s + '|' + t - part2 = hashlib.sha1(part1.encode('utf-8')).hexdigest() - msg = part1 + '|' + part2 + data = s + '|' + t + hashing = data + self._notification_secret + sig = hashlib.sha1(hashing.encode('utf-8')).hexdigest() + msg = data + '|' + sig logger.info('new notification msg: %s.', msg) return msg.encode('utf-8')