--- lib/python/repoinfo.py | 6 ++++++ repoinfo.conf | 4 ++++ 2 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/lib/python/repoinfo.py b/lib/python/repoinfo.py index 420becc..3a8c1f8 100644 --- a/lib/python/repoinfo.py +++ b/lib/python/repoinfo.py @@ -39,6 +39,12 @@ class RepoinfoConfig(object): return [t.strip() for t in itemlist.split(',')] def getarches(self, name): return self._getlist(name, 'arches') + def getreleases(self): + '''Return the list of known, non-EOL releases.''' + return [r for r in repoinfo.repos() if self.config.get(r,'isactiverelease')] + def get_bodhi_releases(self): + '''Return the list of releases known to Bodhi.''' + return [r.upper() for r in self.getreleases()] def getparents(self, name): '''Given a repo name, give the names of its parent repos e.g.: getparents('f13-updates-testing') -> ['f13','f13-updates]''' diff --git a/repoinfo.conf b/repoinfo.conf index 3241044..d36dd93 100644 --- a/repoinfo.conf +++ b/repoinfo.conf @@ -8,6 +8,7 @@ baseurl = http://download.fedoraproject.org/pub/fedora/linux goldurl = %(baseurl)s/releases/%(path)s/Everything/%(arch)s/os updatesurl = %(baseurl)s/updates/%(path)s/%(arch)s rawhideurl = %(baseurl)s/%(path)s/%(arch)s/os +isactiverelease =
# Rawhide [rawhide] @@ -19,6 +20,7 @@ collection_name = devel
# Fedora 14 [f14] +isactiverelease = yes path = development/14 url = %(rawhideurl)s collection_name = F-14 @@ -37,6 +39,7 @@ collection_name = F-14
# Fedora 13 [f13] +isactiverelease = yes path = 13 url = %(goldurl)s collection_name = F-13 @@ -55,6 +58,7 @@ collection_name = F-13
# Fedora 12 [f12] +isactiverelease = yes path = 12 url = %(goldurl)s collection_name = F-12
--- hooks/post-bodhi-update/watch-bodhi-requests.py | 5 +---- 1 files changed, 1 insertions(+), 4 deletions(-)
diff --git a/hooks/post-bodhi-update/watch-bodhi-requests.py b/hooks/post-bodhi-update/watch-bodhi-requests.py index d233a09..45f168f 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.get_bodhi_releases() archlist = ('i686', 'x86_64', 'noarch')
# XXX NOTE we could probably be using cPickle or something here, rather than
Patchset tested, it works well. It may be applied to master. Few comments below.
----- "Will Woods" wwoods@redhat.com wrote:
lib/python/repoinfo.py | 6 ++++++ repoinfo.conf | 4 ++++ 2 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/lib/python/repoinfo.py b/lib/python/repoinfo.py index 420becc..3a8c1f8 100644 --- a/lib/python/repoinfo.py +++ b/lib/python/repoinfo.py @@ -39,6 +39,12 @@ class RepoinfoConfig(object): return [t.strip() for t in itemlist.split(',')] def getarches(self, name): return self._getlist(name, 'arches')
- def getreleases(self):
'''Return the list of known, non-EOL releases.'''
return [r for r in repoinfo.repos() if
self.config.get(r,'isactiverelease')]
- def get_bodhi_releases(self):
'''Return the list of releases known to Bodhi.'''
return [r.upper() for r in self.getreleases()]
If the bodhi tracked releases are always the same as currently active releases (I don't know whether this is true) we can save one method here and just use getreleases() (and .upper()) in the bodhi watcher. But that's just an idea.
def getparents(self, name): '''Given a repo name, give the names of its parent repos e.g.: getparents('f13-updates-testing') ->
['f13','f13-updates]''' diff --git a/repoinfo.conf b/repoinfo.conf index 3241044..d36dd93 100644 --- a/repoinfo.conf +++ b/repoinfo.conf @@ -8,6 +8,7 @@ baseurl = http://download.fedoraproject.org/pub/fedora/linux goldurl = %(baseurl)s/releases/%(path)s/Everything/%(arch)s/os updatesurl = %(baseurl)s/updates/%(path)s/%(arch)s rawhideurl = %(baseurl)s/%(path)s/%(arch)s/os +isactiverelease =
# Rawhide [rawhide] @@ -19,6 +20,7 @@ collection_name = devel
# Fedora 14 [f14] +isactiverelease = yes path = development/14 url = %(rawhideurl)s collection_name = F-14 @@ -37,6 +39,7 @@ collection_name = F-14
# Fedora 13 [f13] +isactiverelease = yes path = 13 url = %(goldurl)s collection_name = F-13 @@ -55,6 +58,7 @@ collection_name = F-13
# Fedora 12 [f12] +isactiverelease = yes path = 12 url = %(goldurl)s collection_name = F-12 -- 1.7.2
autoqa-devel mailing list autoqa-devel@lists.fedorahosted.org https://fedorahosted.org/mailman/listinfo/autoqa-devel
----- "Kamil Paral" kparal@redhat.com wrote:
Patchset tested, it works well. It may be applied to master. Few comments below.
Thanks for testing, Kamil. Will push shortly.
return [r.upper() for r in self.getreleases()]
If the bodhi tracked releases are always the same as currently active releases (I don't know whether this is true) we can save one method here and just use getreleases() (and .upper()) in the bodhi watcher. But that's just an idea.
Well, I can't guarantee that's going to stay true - it works right now, anyway. But that's why we have a (sort of) well-defined API for repoinfo - so the watcher (and anything else using repoinfo) doesn't need to worry about changing their code if Bodhi changes.
We just change repoinfo.get_bodhi_releases() and everything else will work just fine.
-w
autoqa-devel@lists.fedorahosted.org