From 151ade5298301f7473542673d2360de97627a2bf Mon Sep 17 00:00:00 2001 From: Joe Gordon Date: Wed, 11 Sep 2013 17:14:25 -0700 Subject: [PATCH] Update old bug format in recheckwatch When importing a pickled version of the old bug objects, they first need to be converted to contain the duplicate_of attribute. Change-Id: I59dbc27996d579aa7adc644c88c934236edd8623 --- modules/recheckwatch/files/recheckwatch | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/recheckwatch/files/recheckwatch b/modules/recheckwatch/files/recheckwatch index 36b64ee0f5..11238d7857 100755 --- a/modules/recheckwatch/files/recheckwatch +++ b/modules/recheckwatch/files/recheckwatch @@ -112,8 +112,15 @@ class Scoreboard(threading.Thread): # Import here because it needs to happen after daemonization import gerritlib.gerrit self.gerrit = gerritlib.gerrit.Gerrit(server, username, port, keyfile) + self._update_bug_format() self.update() + def _update_bug_format(self): + for bugno, bug in self.scores.items(): + if not hasattr(bug, 'duplicate_of'): + bug.duplicate_of = None + bug.update() + def _read(self, data): if data.get('type', '') != 'comment-added': return