These two patches fix some issues with post-bodhi-update watcher, as discussed on IRC. I haven't really studied working with repoinfo.conf-style config files, so please review if it is correct. Thanks. It is tested and it works.
--- hooks/post-bodhi-update/watch-bodhi-requests.py | 10 +++++++--- 1 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/hooks/post-bodhi-update/watch-bodhi-requests.py b/hooks/post-bodhi-update/watch-bodhi-requests.py index 68843b3..d233a09 100755 --- a/hooks/post-bodhi-update/watch-bodhi-requests.py +++ b/hooks/post-bodhi-update/watch-bodhi-requests.py @@ -200,8 +200,8 @@ when new requests are filed in bodhi') try: new_updates = bodhi_new_requests_since(r, int(lastcheck), testing_cachefile, updatecache=(not opts.dryrun)) - except fedora.client.ServerError, e: - print "ERROR: %s" % str(e) + except fedora.client.FedoraServiceError as e: + print "ERROR: %s" % e # Sort the new updates based on their target/request updates = {'testing': [], 'stable': [], 'critpath': []} for u in new_updates: @@ -212,8 +212,12 @@ when new requests are filed in bodhi') len(updates['critpath']))
print "Looking for requests moving from testing to stable for %s" % r - new_updates = bodhi_new_stable_requests(r, stable_cachefile, + try: + new_updates = [] + new_updates = bodhi_new_stable_requests(r, stable_cachefile, updatecache=(not opts.dryrun)) + except fedora.client.FedoraServiceError as e: + print "ERROR: %s" % e print "%i stable update requests found" % len(new_updates) updates['stable'] += new_updates
On Wed, 2010-08-04 at 10:20 +0200, Kamil Páral wrote:
hooks/post-bodhi-update/watch-bodhi-requests.py | 10 +++++++--- 1 files changed, 7 insertions(+), 3 deletions(-)
Applied to master - thanks.
-w
----- "Will Woods" wwoods@redhat.com wrote:
On Wed, 2010-08-04 at 10:20 +0200, Kamil Páral wrote:
hooks/post-bodhi-update/watch-bodhi-requests.py | 10 +++++++--- 1 files changed, 7 insertions(+), 3 deletions(-)
Applied to master - thanks.
You say "applied", but I didn't see it there. So I pushed it.
--- hooks/post-bodhi-update/watch-bodhi-requests.py | 5 +---- lib/python/repoinfo.py | 6 +++--- repoinfo.conf | 1 + 3 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/hooks/post-bodhi-update/watch-bodhi-requests.py b/hooks/post-bodhi-update/watch-bodhi-requests.py index d233a09..b1cdca6 100755 --- a/hooks/post-bodhi-update/watch-bodhi-requests.py +++ b/hooks/post-bodhi-update/watch-bodhi-requests.py @@ -64,10 +64,7 @@ except OSError, e: if e.errno != 17: # already exists raise
-# XXX we should have actual repoinfo data for these -#bodhi_releases = [r['bodhi_release'] for r in repoinfo.repos() -# if 'bodhi_release' in r] -bodhi_releases = ['F11','F12','F13'] +bodhi_releases = repoinfo.getlist('DEFAULT', 'releases') archlist = ('i686', 'x86_64', 'noarch')
# XXX NOTE we could probably be using cPickle or something here, rather than diff --git a/lib/python/repoinfo.py b/lib/python/repoinfo.py index 420becc..2e0296d 100644 --- a/lib/python/repoinfo.py +++ b/lib/python/repoinfo.py @@ -31,18 +31,18 @@ class RepoinfoConfig(object): self.filelist = filelist self.setarch(arch) # implies read()
- def _getlist(self, name, item): + def getlist(self, name, item): itemlist = self.config.get(name, item) if not itemlist: return [] else: return [t.strip() for t in itemlist.split(',')] def getarches(self, name): - return self._getlist(name, 'arches') + return self.getlist(name, 'arches') def getparents(self, name): '''Given a repo name, give the names of its parent repos e.g.: getparents('f13-updates-testing') -> ['f13','f13-updates]''' - return self._getlist(name, 'parents') + return self.getlist(name, 'parents') def getrepo(self, name): '''Given a repo name, return the repoinfo dict, with the keys: 'arches', 'parents', 'tag', 'url', 'path', 'name' ''' diff --git a/repoinfo.conf b/repoinfo.conf index 3241044..cb1817c 100644 --- a/repoinfo.conf +++ b/repoinfo.conf @@ -1,4 +1,5 @@ [DEFAULT] +releases = F12, F13, F14 parents = arches = i386, x86_64, ppc composes =
On Wed, 2010-08-04 at 10:20 +0200, Kamil Páral wrote:
-# XXX we should have actual repoinfo data for these -#bodhi_releases = [r['bodhi_release'] for r in repoinfo.repos() -# if 'bodhi_release' in r] -bodhi_releases = ['F11','F12','F13'] +bodhi_releases = repoinfo.getlist('DEFAULT', 'releases')
The DEFAULT section applies the listed keys to *every* section in the file - so this works, but it doesn't really make sense.
- def _getlist(self, name, item):
- def getlist(self, name, item):
_getlist() was intentionally 'private' - I wanted repoinfo data to be fetched by accessor methods, rather than having people poke around the file somewhat by hand.
diff --git a/repoinfo.conf b/repoinfo.conf index 3241044..cb1817c 100644 --- a/repoinfo.conf +++ b/repoinfo.conf @@ -1,4 +1,5 @@ [DEFAULT] +releases = F12, F13, F14
Rather than adding this, I'd prefer marking the repos which correspond to active releases, and building the release list that way.
A patch will be along shortly.
-w
autoqa-devel@lists.fedorahosted.org