bodhi/util.py
by Luke Macken
bodhi/util.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit 564dce295d1090634cdf802155439de7b26f5350
Author: Luke Macken <lmacken(a)redhat.com>
Date: Sat Feb 20 10:00:31 2010 -0500
It's too early to be coding...
diff --git a/bodhi/util.py b/bodhi/util.py
index db00aca..7c1de11 100644
--- a/bodhi/util.py
+++ b/bodhi/util.py
@@ -38,7 +38,7 @@ from fedora.client import PackageDB
try:
from fedora.tg.tg1utils import url as csrf_url, tg_url, request_format
-except ImportError
+except ImportError:
from fedora.tg.util import url as csrf_url, tg_url, request_format
from bodhi.exceptions import (RPMNotFound, RepodataException,
14 years, 2 months
bodhi/util.py
by Luke Macken
bodhi/util.py | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
New commits:
commit bf1ee4d12f0dcc507bcc203c3bcd666882e31982
Author: Luke Macken <lmacken(a)redhat.com>
Date: Sat Feb 20 10:00:11 2010 -0500
More python-fedora compatibility
diff --git a/bodhi/util.py b/bodhi/util.py
index e6e7b05..db00aca 100644
--- a/bodhi/util.py
+++ b/bodhi/util.py
@@ -35,7 +35,11 @@ from datetime import datetime
from decorator import decorator
from turbogears import config, flash, redirect
from fedora.client import PackageDB
-from fedora.tg.tg1utils import url as csrf_url, tg_url, request_format
+
+try:
+ from fedora.tg.tg1utils import url as csrf_url, tg_url, request_format
+except ImportError
+ from fedora.tg.util import url as csrf_url, tg_url, request_format
from bodhi.exceptions import (RPMNotFound, RepodataException,
InvalidUpdateException)
14 years, 2 months
bodhi/model.py
by Luke Macken
bodhi/model.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit 2fc15decf4e1629310b642a28ee8abc6c2f33efe
Author: Luke Macken <lmacken(a)redhat.com>
Date: Sat Feb 20 09:58:27 2010 -0500
Fix a tpyo
diff --git a/bodhi/model.py b/bodhi/model.py
index b1d23cd..81fe140 100644
--- a/bodhi/model.py
+++ b/bodhi/model.py
@@ -32,7 +32,7 @@ from textwrap import wrap
try:
from fedora.tg.tg1utils import tg_url
-except ImpotError:
+except ImportError:
from fedora.tg.util import tg_url
from bodhi import buildsys, mail
14 years, 2 months
bodhi/admin.py bodhi/controllers.py bodhi/metrics.py bodhi/model.py
by Luke Macken
bodhi/admin.py | 6 +++++-
bodhi/controllers.py | 6 +++++-
bodhi/metrics.py | 5 ++++-
bodhi/model.py | 6 +++++-
4 files changed, 19 insertions(+), 4 deletions(-)
New commits:
commit 1e43dd04dcaf05ae27d9348dfea3c89ba85b8257
Author: Luke Macken <lmacken(a)redhat.com>
Date: Sat Feb 20 09:56:01 2010 -0500
Don't jump the gun on python-fedora tg1utils.
Apparently I was running the latest trunk of python-fedora, so this
patch makes bodhi work with all versions.
diff --git a/bodhi/admin.py b/bodhi/admin.py
index 793f477..b8aa36a 100644
--- a/bodhi/admin.py
+++ b/bodhi/admin.py
@@ -27,7 +27,11 @@ from turbogears import expose, identity, redirect, flash, config, validate
from turbogears.identity import SecureResource
from turbogears.controllers import Controller
-from fedora.tg.tg1utils import request_format
+try:
+ from fedora.tg.tg1utils import request_format
+except ImportError:
+ from fedora.tg.util import request_format
+
from fedora.client.proxyclient import ProxyClient
from bodhi.util import flash_log
diff --git a/bodhi/controllers.py b/bodhi/controllers.py
index 277c856..11a980a 100644
--- a/bodhi/controllers.py
+++ b/bodhi/controllers.py
@@ -32,7 +32,11 @@ from turbogears import (controllers, expose, validate, redirect, identity,
from turbogears import url as tg_url
from turbogears.widgets import DataGrid
-from fedora.tg.tg1utils import request_format
+try:
+ from fedora.tg.tg1utils import request_format
+except ImportError:
+ from fedora.tg.tutil import request_format
+
from fedora.tg.controllers import login as fc_login
from fedora.tg.controllers import logout as fc_logout
diff --git a/bodhi/metrics.py b/bodhi/metrics.py
index a6096ea..09552ea 100644
--- a/bodhi/metrics.py
+++ b/bodhi/metrics.py
@@ -21,7 +21,10 @@ from turboflot import TurboFlot
from turbogears import expose, config, flash, redirect
from turbogears.controllers import Controller
-from fedora.tg.tg1utils import request_format
+try:
+ from fedora.tg.tg1utils import request_format
+except ImportError:
+ from fedora.tg.util import request_format
from bodhi.util import Singleton, get_age_in_days
from bodhi.model import PackageUpdate, Release, hub
diff --git a/bodhi/model.py b/bodhi/model.py
index 6e4caee..b1d23cd 100644
--- a/bodhi/model.py
+++ b/bodhi/model.py
@@ -30,7 +30,11 @@ from turbogears.identity import RequestRequiredException
from os.path import isfile, join
from textwrap import wrap
-from fedora.tg.tg1utils import tg_url
+try:
+ from fedora.tg.tg1utils import tg_url
+except ImpotError:
+ from fedora.tg.util import tg_url
+
from bodhi import buildsys, mail
from bodhi.util import get_nvr, rpm_fileheader, header, get_age, get_age_in_days
from bodhi.util import Singleton, authorized_user, flash_log, build_evr, url
14 years, 2 months
bodhi/admin.py bodhi/controllers.py bodhi/metrics.py
by Luke Macken
bodhi/admin.py | 2 +-
bodhi/controllers.py | 2 +-
bodhi/metrics.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
New commits:
commit cd3be1975cfda16fda616b6eb2fc93ebf054814e
Author: Luke Macken <lmacken(a)redhat.com>
Date: Sat Feb 20 09:46:18 2010 -0500
Fix some more python-fedora deprecation warnings
diff --git a/bodhi/admin.py b/bodhi/admin.py
index 7d80d25..793f477 100644
--- a/bodhi/admin.py
+++ b/bodhi/admin.py
@@ -27,7 +27,7 @@ from turbogears import expose, identity, redirect, flash, config, validate
from turbogears.identity import SecureResource
from turbogears.controllers import Controller
-from fedora.tg.util import request_format
+from fedora.tg.tg1utils import request_format
from fedora.client.proxyclient import ProxyClient
from bodhi.util import flash_log
diff --git a/bodhi/controllers.py b/bodhi/controllers.py
index ce4207a..277c856 100644
--- a/bodhi/controllers.py
+++ b/bodhi/controllers.py
@@ -32,7 +32,7 @@ from turbogears import (controllers, expose, validate, redirect, identity,
from turbogears import url as tg_url
from turbogears.widgets import DataGrid
-from fedora.tg.util import request_format
+from fedora.tg.tg1utils import request_format
from fedora.tg.controllers import login as fc_login
from fedora.tg.controllers import logout as fc_logout
diff --git a/bodhi/metrics.py b/bodhi/metrics.py
index 00f8c3c..a6096ea 100644
--- a/bodhi/metrics.py
+++ b/bodhi/metrics.py
@@ -21,7 +21,7 @@ from turboflot import TurboFlot
from turbogears import expose, config, flash, redirect
from turbogears.controllers import Controller
-from fedora.tg.util import request_format
+from fedora.tg.tg1utils import request_format
from bodhi.util import Singleton, get_age_in_days
from bodhi.model import PackageUpdate, Release, hub
14 years, 2 months
bodhi/model.py bodhi/util.py
by Luke Macken
bodhi/model.py | 2 +-
bodhi/util.py | 4 +---
2 files changed, 2 insertions(+), 4 deletions(-)
New commits:
commit 7615037e3d58225256ab499a18392da9ce0ff4f3
Author: Luke Macken <lmacken(a)redhat.com>
Date: Sat Feb 20 09:42:23 2010 -0500
Fix some python-fedora deprecation warnings
diff --git a/bodhi/model.py b/bodhi/model.py
index 25145ea..6e4caee 100644
--- a/bodhi/model.py
+++ b/bodhi/model.py
@@ -30,7 +30,7 @@ from turbogears.identity import RequestRequiredException
from os.path import isfile, join
from textwrap import wrap
-from fedora.tg.util import tg_url
+from fedora.tg.tg1utils import tg_url
from bodhi import buildsys, mail
from bodhi.util import get_nvr, rpm_fileheader, header, get_age, get_age_in_days
from bodhi.util import Singleton, authorized_user, flash_log, build_evr, url
diff --git a/bodhi/util.py b/bodhi/util.py
index 292a556..e6e7b05 100644
--- a/bodhi/util.py
+++ b/bodhi/util.py
@@ -34,10 +34,8 @@ from os.path import isdir, join, dirname, basename, isfile
from datetime import datetime
from decorator import decorator
from turbogears import config, flash, redirect
-from fedora.tg.util import request_format
from fedora.client import PackageDB
-from fedora.tg.util import url as csrf_url
-from fedora.tg.util import tg_url
+from fedora.tg.tg1utils import url as csrf_url, tg_url, request_format
from bodhi.exceptions import (RPMNotFound, RepodataException,
InvalidUpdateException)
14 years, 2 months
2 commits - bodhi/masher.py bodhi/model.py
by Luke Macken
bodhi/masher.py | 5 +++--
bodhi/model.py | 14 ++++++++++----
2 files changed, 13 insertions(+), 6 deletions(-)
New commits:
commit c238cbe1e0e1afde6dd949e35b91f12a00c1d58c
Author: Luke Macken <lmacken(a)redhat.com>
Date: Fri Feb 19 22:49:48 2010 -0500
Don't use mutable keyword arguments.
This bug caused our masher to unnecessarily mash repos that it didn't need to,
and thus this fix will save us a lot of time.
diff --git a/bodhi/masher.py b/bodhi/masher.py
index 40a7356..5c0e178 100644
--- a/bodhi/masher.py
+++ b/bodhi/masher.py
@@ -73,7 +73,7 @@ class Masher(object):
self.last_log = None
@synchronized(lock)
- def queue(self, updates, repos=set(), resume=False):
+ def queue(self, updates, repos=None, resume=False):
self._queue.append((self.thread_id, updates, repos, resume))
self.thread_id += 1
if len(self._threads) == 0:
@@ -153,7 +153,7 @@ class Masher(object):
class MashTask(Thread):
- def __init__(self, id, updates, repos=set(), resume=False):
+ def __init__(self, id, updates, repos=None, resume=False):
""" Initialize a new MashTask thread.
@param updates: a list of PackageUpdate objects that we want to push
@@ -163,6 +163,7 @@ class MashTask(Thread):
is mash the repositories, close bugs, and send out update notices.
"""
Thread.__init__(self)
+ repos = repos and set(repos) or set()
log.debug("MashTask(%d, %s, %s, %s)" % (id, updates, repos, resume))
self.id = id
self.tag = None
commit 7edcb9c4b1c21144d08e727172c01048e534f69a
Author: Luke Macken <lmacken(a)redhat.com>
Date: Fri Feb 19 22:26:01 2010 -0500
Make PackageUpdate.comment work outside of a request (eg: during a push)
diff --git a/bodhi/model.py b/bodhi/model.py
index 14653dc..25145ea 100644
--- a/bodhi/model.py
+++ b/bodhi/model.py
@@ -25,6 +25,7 @@ from datetime import datetime
from turbogears import config
from turbogears.database import PackageHub
+from turbogears.identity import RequestRequiredException
from os.path import isfile, join
from textwrap import wrap
@@ -695,10 +696,15 @@ class PackageUpdate(SQLObject):
admin_groups = config.get('admin_groups',
'releng qa security_respons').split()
- for group in identity.current.groups:
- if group in admin_groups:
- author += ' (%s)' % group
- break
+ try:
+ for group in identity.current.groups:
+ if group in admin_groups:
+ author += ' (%s)' % group
+ break
+ except RequestRequiredException:
+ # This happens when we're adding comments from the masher,
+ # in which case this block is not necessary
+ pass
if not anonymous and karma != 0 and \
not filter(lambda c: c.author == author and c.karma == karma,
14 years, 2 months
Branch 'tg2' - 2 commits - bodhi/bodhi bodhi/development.ini
by Mathieu Bridon
bodhi/bodhi/model/model.py | 11 +++++------
bodhi/bodhi/tests/models/test_model.py | 22 +++++++++++-----------
bodhi/development.ini | 3 ++-
3 files changed, 18 insertions(+), 18 deletions(-)
New commits:
commit 76186e9fc3bf3924db362597fd701b40bc7e2592
Author: Mathieu Bridon <bochecha(a)fedoraproject.org>
Date: Fri Feb 19 00:18:57 2010 +0100
Remove the hardcoded Bugzilla URL from the model, this should be a configuration.
diff --git a/bodhi/bodhi/model/model.py b/bodhi/bodhi/model/model.py
index ca1118c..1041691 100644
--- a/bodhi/bodhi/model/model.py
+++ b/bodhi/bodhi/model/model.py
@@ -905,9 +905,8 @@ class Bug(DeclarativeBase):
except xmlrpclib.Fault, f:
log.error("Unable to close bug #%d: %s" % (self.bug_id, str(f)))
-# TODO: remove this
def get_url(self):
- return "https://bugzilla.redhat.com/show_bug.cgi?id=%s" % self.bug_id
+ return "%s/show_bug.cgi?id=%s" % (config.get('bz_baseurl'), self.bug_id)
# TODO; put this somewhere else!
diff --git a/bodhi/development.ini b/bodhi/development.ini
index 8855b2a..dac7f54 100644
--- a/bodhi/development.ini
+++ b/bodhi/development.ini
@@ -209,7 +209,8 @@ pkgdb_url = https://admin.fedoraproject.org/pkgdb
## Bugzilla settings. The username/password for our bugzilla account comes
## from the bodhi_{email,password} fields.
##
-bz_server = https://bugzilla.redhat.com/xmlrpc.cgi
+bz_baseurl = https://bugzilla.redhat.com
+bz_server = %(bz_baseurl)s/xmlrpc.cgi
bz_cookie = None
##
commit 4a300ead149909f05a8eb4b578e1fd619dd817c7
Author: Mathieu Bridon <bochecha(a)fedoraproject.org>
Date: Thu Feb 18 22:51:06 2010 +0100
Update alias modifications.
The update alias was made unique, to avoid any issue like what just happened in
production.
Also, the assign_id method was renamed to assign_alias, as that's what it
actually does.
diff --git a/bodhi/bodhi/model/model.py b/bodhi/bodhi/model/model.py
index b89ffdd..ca1118c 100644
--- a/bodhi/bodhi/model/model.py
+++ b/bodhi/bodhi/model/model.py
@@ -231,7 +231,7 @@ class Update(DeclarativeBase):
releng_approval_date = Column(DateTime)
# eg: FEDORA-EPEL-2009-12345
- alias = Column(Unicode(32), default=None)
+ alias = Column(Unicode(32), default=None, unique=True)
# One-to-one relationships
release_id = Column(Integer, ForeignKey('releases.id'))
@@ -289,7 +289,7 @@ class Update(DeclarativeBase):
""" Return a space-delimited string of CVE ids for this update """
return u' '.join([cve.cve_id for cve in self.cves])
- def assign_id(self):
+ def assign_alias(self):
"""Assign an update ID to this update.
This function finds the next number in the sequence of pushed updates
@@ -405,7 +405,7 @@ class Update(DeclarativeBase):
self.pushed = True
self.date_pushed = datetime.utcnow()
self.status = u'testing'
- self.assign_id()
+ self.assign_alias()
elif self.request == u'obsolete':
self.pushed = False
self.status = u'obsolete'
@@ -413,7 +413,7 @@ class Update(DeclarativeBase):
self.pushed = True
self.date_pushed = datetime.utcnow()
self.status = u'stable'
- self.assign_id()
+ self.assign_alias()
self.request = None
def modify_bugs(self):
diff --git a/bodhi/bodhi/tests/models/test_model.py b/bodhi/bodhi/tests/models/test_model.py
index 1a0476f..9a760f3 100644
--- a/bodhi/bodhi/tests/models/test_model.py
+++ b/bodhi/bodhi/tests/models/test_model.py
@@ -152,15 +152,15 @@ class TestUpdate(ModelTest):
def test_cvestring(self):
eq_(self.obj.get_cvestring(), u'CVE-2009-0001')
- def test_assign_id(self):
+ def test_assign_alias(self):
update = self.obj
- update.assign_id()
+ update.assign_alias()
eq_(update.alias, u'%s-%s-0001' % (update.release.id_prefix,
time.localtime()[0]))
#assert update.date_pushed
update = self.get_update(name=u'TurboGears-0.4.4-8.fc11')
- update.assign_id()
+ update.assign_alias()
eq_(update.alias, u'%s-%s-0002' % (update.release.id_prefix,
time.localtime()[0]))
@@ -171,47 +171,47 @@ class TestUpdate(ModelTest):
otherrel = model.Release(name=u'fc10', long_name=u'Fedora 10',
id_prefix=u'FEDORA', dist_tag=u'dist-fc10')
update.release = otherrel
- update.assign_id()
+ update.assign_alias()
eq_(update.alias, u'%s-%s-0003' % (update.release.id_prefix,
time.localtime()[0]))
## 10k bug
update.alias = u'FEDORA-2010-9999'
newupdate = self.get_update(name=u'nethack-2.5.6-1.fc10')
- newupdate.assign_id()
+ newupdate.assign_alias()
eq_(newupdate.alias, u'FEDORA-2010-10000')
newerupdate = self.get_update(name=u'nethack-2.5.7-1.fc10')
- newerupdate.assign_id()
+ newerupdate.assign_alias()
eq_(newerupdate.alias, u'FEDORA-2010-10001')
- ## test updates that were pushed at the same time. assign_id should
+ ## test updates that were pushed at the same time. assign_alias should
## be able to figure out which one has the highest id.
now = datetime.utcnow()
newupdate.date_pushed = now
newerupdate.date_pushed = now
newest = self.get_update(name=u'nethack-2.5.8-1.fc10')
- newest.assign_id()
+ newest.assign_alias()
eq_(newest.alias, u'FEDORA-2010-10002')
def test_epel_id(self):
""" Make sure we can handle id_prefixes that contain dashes. eg: FEDORA-EPEL """
# Create a normal Fedora update first
update = self.obj
- update.assign_id()
+ update.assign_alias()
eq_(update.alias, u'FEDORA-%s-0001' % time.localtime()[0])
update = self.get_update(name=u'TurboGears-2.1-1.el5')
release = model.Release(name=u'EL-5', long_name=u'Fedora EPEL 5',
dist_tag=u'dist-5E-epel', id_prefix=u'FEDORA-EPEL')
update.release = release
- update.assign_id()
+ update.assign_alias()
eq_(update.alias, u'FEDORA-EPEL-%s-0001' % time.localtime()[0])
update = self.get_update(name=u'TurboGears-2.2-1.el5')
update.release = release
- update.assign_id()
+ update.assign_alias()
eq_(update.alias, u'%s-%s-0002' % (release.id_prefix,
time.localtime()[0]))
14 years, 2 months
bodhi/model.py
by Luke Macken
bodhi/model.py | 2 --
1 file changed, 2 deletions(-)
New commits:
commit 833a783a874d7d6aab588536e4ee4be9a2aba334
Author: Luke Macken <lmacken(a)redhat.com>
Date: Thu Feb 18 12:02:41 2010 -0500
Revert "Reset the PackageUpdate.date_pushed when a testing update hits stable"
This reverts commit 738f0b74947c96512034277ca0844d35200f66cd.
I'm pretty sure this causes duplicate updateids to get generated.
diff --git a/bodhi/model.py b/bodhi/model.py
index 0ec50a9..14653dc 100644
--- a/bodhi/model.py
+++ b/bodhi/model.py
@@ -442,7 +442,6 @@ class PackageUpdate(SQLObject):
self.pushed = True
self.status = 'testing'
self.assign_id()
- self.date_pushed = datetime.utcnow()
elif self.request == 'obsolete':
self.pushed = False
self.status = 'obsolete'
@@ -450,7 +449,6 @@ class PackageUpdate(SQLObject):
self.pushed = True
self.status = 'stable'
self.assign_id()
- self.date_pushed = datetime.utcnow()
self.request = None
hub.commit()
14 years, 2 months
bodhi/templates
by Luke Macken
bodhi/templates/show.kid | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
New commits:
commit 1a37dffc6a78022a9b4ed6528c2bf6a7a1f1cb1f
Author: Josh Kayse <joshkayse(a)fedoraproject.org>
Date: Mon Feb 8 11:49:23 2010 -0500
do not show a push to testing link if an update is in testing
diff --git a/bodhi/templates/show.kid b/bodhi/templates/show.kid
index 4c3e99d..11fe04b 100644
--- a/bodhi/templates/show.kid
+++ b/bodhi/templates/show.kid
@@ -65,12 +65,14 @@ karma = "<img src=\"%s\" align=\"top\" /> <b>%d</b>" % (tg.url('/static/images/k
</td>
</span>
<span py:if="update.request == None">
- <td>
- <a href="${util.url('/request/testing/%s' % update.title)}" class="list">
- <img src="${tg.url('/static/images/testing.png')}" border="0"/>
- Push to Testing
- </a>
- </td>
+ <span py:if="update.status != 'testing'">
+ <td>
+ <a href="${util.url('/request/testing/%s' % update.title)}" class="list">
+ <img src="${tg.url('/static/images/testing.png')}" border="0"/>
+ Push to Testing
+ </a>
+ </td>
+ </span>
<span py:if="update.release.locked and update.critpath and update.critpath_approved">
<span py:if="'qa' in tg.identity.groups or 'releng' in tg.identity.groups">
<td>
14 years, 2 months