2 commits - bodhi/model.py
by Luke Macken
bodhi/model.py | 28 ++++++++++++++++------------
1 file changed, 16 insertions(+), 12 deletions(-)
New commits:
commit 48732b8ba9cfdf8e2ceb0363756b399ceffad7ae
Author: Luke Macken <lmacken(a)redhat.com>
Date: Wed Aug 31 12:57:35 2011 -0400
Switch to preferring update IDs as URLs as opposed to a list of builds.
This will mitigate issues when an update is edited and builds are
added/removed, and thus previous URLs are invalid.
diff --git a/bodhi/model.py b/bodhi/model.py
index 5185cc7..1535630 100644
--- a/bodhi/model.py
+++ b/bodhi/model.py
@@ -661,12 +661,11 @@ class PackageUpdate(SQLObject):
def get_url(self):
""" Return the relative URL to this update """
path = ['/']
- # Until our update ids are reliable...
- #if self.updateid:
- # path.append(self.release.name)
- # path.append(self.updateid)
- #else:
- path.append(self.title)
+ if self.updateid:
+ #path.append(self.release.name)
+ path.append(self.updateid)
+ else:
+ path.append(self.title)
return join(*path)
def __str__(self):
commit 83ee9296999c8ad14d6604d5f27736319a126da9
Author: Luke Macken <lmacken(a)redhat.com>
Date: Thu Aug 25 09:36:30 2011 -0400
Apply a patch from Scop to reduce unnecessary Bugzilla mail by commenting &
closing bugs at the same time.
diff --git a/bodhi/model.py b/bodhi/model.py
index 2cccdf4..5185cc7 100644
--- a/bodhi/model.py
+++ b/bodhi/model.py
@@ -573,7 +573,6 @@ class PackageUpdate(SQLObject):
if self.status == 'testing':
map(lambda bug: bug.testing(self), self.bugs)
elif self.status == 'stable':
- map(lambda bug: bug.add_comment(self), self.bugs)
if self.close_bugs:
if self.type == 'security':
@@ -581,7 +580,7 @@ class PackageUpdate(SQLObject):
for bug in self.bugs:
if not bug.parent:
log.debug("Closing tracker bug %d" % bug.bz_id)
- bug.close_bug(self)
+ bug.close_bug(self, bug._default_message(self))
# Now, close our parents bugs as long as nothing else
# depends on them, and they are not in a NEW state
@@ -592,6 +591,7 @@ class PackageUpdate(SQLObject):
if parent.bug_status == "NEW":
log.debug("Parent bug %d is still NEW; not "
"closing.." % bug.bz_id)
+ bug.add_comment(self)
continue
depsclosed = True
for dep in parent.dependson:
@@ -608,9 +608,14 @@ class PackageUpdate(SQLObject):
break
if depsclosed:
log.debug("Closing parent bug %d" % bug.bz_id)
- bug.close_bug(self)
+ bug.close_bug(self, bug._default_message(self))
+ else:
+ bug.add_comment(self)
else:
- map(lambda bug: bug.close_bug(self), self.bugs)
+ map(lambda bug: bug.close_bug(
+ self, bug._default_message(self)), self.bugs)
+ else:
+ map(lambda bug: bug.add_comment(self), self.bugs)
def status_comment(self):
"""
@@ -1429,7 +1434,7 @@ class Bugzilla(SQLObject):
else:
log.debug('Skipping bug modification, close_bugs == False')
- def close_bug(self, update):
+ def close_bug(self, update, comment=''):
"""Close this bugzilla with details from an update.
This method will only close Fedora or Fedora EPEL bugs, and it will
@@ -1442,7 +1447,7 @@ class Bugzilla(SQLObject):
if bug.product not in config.get('bz_products', '').split(','):
log.warning("Not closing %r bug" % bug.product)
return
- bug.close('ERRATA', fixedin=update.builds[0].nvr)
+ bug.close('ERRATA', fixedin=update.builds[0].nvr, comment=comment)
except xmlrpclib.Fault, f:
log.error("Unable to close bug #%d: %s" % (self.bz_id, str(f)))
12 years, 7 months
bodhi/controllers.py
by Luke Macken
bodhi/controllers.py | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
New commits:
commit 25886ac88d469e413b1330594432e7b0c335b60e
Author: Luke Macken <lmacken(a)redhat.com>
Date: Wed Aug 24 12:53:31 2011 -0400
If we're on python2.6, make sure we don't break on hyphens when wrapping text
diff --git a/bodhi/controllers.py b/bodhi/controllers.py
index 5764f04..95ac4f8 100644
--- a/bodhi/controllers.py
+++ b/bodhi/controllers.py
@@ -1307,8 +1307,13 @@ class Root(controllers.RootController):
if text == 'None':
text = None
else:
- text = textwrap.TextWrapper(width=80,
- break_long_words=False).fill(text)
+ try: # Python 2.6+
+ text = textwrap.TextWrapper(width=80,
+ break_long_words=False,
+ break_on_hyphens=False).fill(text)
+ except TypeError: # Python 2.4
+ text = textwrap.TextWrapper(width=80,
+ break_long_words=False).fill(text)
update.comment(text, karma, author=author, anonymous=True)
raise redirect(update.get_url())
@@ -1351,8 +1356,13 @@ class Root(controllers.RootController):
if text == 'None':
text = None
else:
- text = textwrap.TextWrapper(width=80,
- break_long_words=False).fill(text)
+ try: # Python 2.6+
+ text = textwrap.TextWrapper(width=80,
+ break_long_words=False,
+ break_on_hyphens=False).fill(text)
+ except TypeError: # Python 2.4
+ text = textwrap.TextWrapper(width=80,
+ break_long_words=False).fill(text)
update.comment(text, karma, email=email)
if request_format() == 'json':
return dict(update=update.__json__())
12 years, 8 months
2 commits - bodhi/admin.py bodhi/masher.py
by Luke Macken
bodhi/admin.py | 4 ++--
bodhi/masher.py | 5 ++++-
2 files changed, 6 insertions(+), 3 deletions(-)
New commits:
commit 7408fd504ddbe5eadaf10d0b6fc23a7b26d9accd
Author: Luke Macken <lmacken(a)redhat.com>
Date: Mon Aug 22 10:13:47 2011 -0400
Make our buildroot override expiration more robust
diff --git a/bodhi/masher.py b/bodhi/masher.py
index e6e66a4..fe1b26f 100644
--- a/bodhi/masher.py
+++ b/bodhi/masher.py
@@ -477,7 +477,10 @@ class MashTask(Thread):
""" Obsolete any buildroot overrides that are in this push """
for update in self.updates:
if update.request == 'stable':
- update.expire_buildroot_overrides()
+ try:
+ update.expire_buildroot_overrides()
+ except Exception, e:
+ log.exception(e)
# With a large pushes, this tends to cause much buildsystem churn, as well
# as polluting the tag history.
commit f8ab54f667b7c2479a05652784e6d33f18390ea8
Author: Luke Macken <lmacken(a)redhat.com>
Date: Mon Aug 22 10:13:35 2011 -0400
Update our tag usage in our admin.py to work with the new koji tag schema
diff --git a/bodhi/admin.py b/bodhi/admin.py
index e820ece..c1a36c9 100644
--- a/bodhi/admin.py
+++ b/bodhi/admin.py
@@ -62,8 +62,8 @@ class AdminController(Controller, SecureResource):
from bodhi.masher import masher
tags = []
for release in Release.select():
- tags.append('%s-updates' % release.dist_tag.split('-')[1])
- tags.append('%s-updates-testing' % release.dist_tag.split('-')[1])
+ tags.append(release.stable_tag)
+ tags.append(release.testing_tag)
return dict(masher_str=str(masher), tags=tags)
@expose(template='bodhi.templates.text')
12 years, 8 months
bodhi/controllers.py
by Luke Macken
bodhi/controllers.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit cc94229fdab91cfdbad3251e9578cf90b41be39e
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue Aug 16 22:52:54 2011 -0400
Handle koji.GenericError when removing pending tags
diff --git a/bodhi/controllers.py b/bodhi/controllers.py
index 7ccd4aa..5764f04 100644
--- a/bodhi/controllers.py
+++ b/bodhi/controllers.py
@@ -758,7 +758,7 @@ class Root(controllers.RootController):
elif edited.request == 'stable':
koji.tagBuild(edited.release.pending_stable_tag,
build, force=True)
- except TagError, e:
+ except (TagError, GenericError), e:
log.exception(e)
for build in edited_builds:
12 years, 8 months
bodhi/model.py
by Luke Macken
bodhi/model.py | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
New commits:
commit c2468a498893b33203665d351e9b8fbe8c722cdd
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue Aug 16 12:11:03 2011 -0400
Make our override expiration during unpush more robust (rel-eng#4853)
diff --git a/bodhi/model.py b/bodhi/model.py
index 9169dc7..2cccdf4 100644
--- a/bodhi/model.py
+++ b/bodhi/model.py
@@ -934,7 +934,11 @@ class PackageUpdate(SQLObject):
log.debug('Tasks complete!')
# Expire any buildroot overrides
- self.expire_buildroot_overrides()
+ try:
+ self.expire_buildroot_overrides()
+ except Exception, e:
+ log.exception(e)
+ log.error('There was non-fatal problem expiring the override')
self.pushed = False
self.status = 'pending'
12 years, 8 months
bodhi/metadata.py
by Luke Macken
bodhi/metadata.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit 495c4690d4e13e837c74723682ea76befc6eed38
Author: Luke Macken <lmacken(a)redhat.com>
Date: Fri Aug 12 12:20:14 2011 -0400
Fix a bug with our previous commit
diff --git a/bodhi/metadata.py b/bodhi/metadata.py
index b628d07..503ec64 100644
--- a/bodhi/metadata.py
+++ b/bodhi/metadata.py
@@ -252,7 +252,7 @@ class ExtendedMetadata(object):
arch = rpm['arch']
urlpath = join(config.get('file_url'),
update.status == 'testing' and 'testing' or '',
- update.release.get_version(), arch, filename)
+ str(update.release.get_version()), arch, filename)
pkg = self._insert(collection, 'package', attrs={
'name' : rpm['name'],
'version' : rpm['version'],
12 years, 8 months
bodhi/metadata.py
by Luke Macken
bodhi/metadata.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit 7c820277c84674884c6874bd6e272ef396a250e8
Author: Luke Macken <lmacken(a)redhat.com>
Date: Thu Aug 4 12:13:30 2011 -0400
Fix an invalid path in our updateinfo.xml metadata (rel-eng#4860)
https://fedorahosted.org/rel-eng/ticket/4860
diff --git a/bodhi/metadata.py b/bodhi/metadata.py
index 04c43e5..b628d07 100644
--- a/bodhi/metadata.py
+++ b/bodhi/metadata.py
@@ -252,7 +252,7 @@ class ExtendedMetadata(object):
arch = rpm['arch']
urlpath = join(config.get('file_url'),
update.status == 'testing' and 'testing' or '',
- update.release.name[-1], arch, filename)
+ update.release.get_version(), arch, filename)
pkg = self._insert(collection, 'package', attrs={
'name' : rpm['name'],
'version' : rpm['version'],
12 years, 8 months