bodhi/buildsys.py | 6 +++++-
bodhi/controllers.py | 17 +++++++++++++++++
bodhi/model.py | 2 ++
3 files changed, 24 insertions(+), 1 deletion(-)
New commits:
commit 662cb826f3ebc463954655c6ce716fd8d5229804
Author: Luke Macken <lmacken(a)redhat.com>
Date: Wed May 19 12:13:12 2010 -0400
Only deny editing an update if there is an active request. If not, log a warning...
diff --git a/bodhi/buildsys.py b/bodhi/buildsys.py
index 4ebafb4..f0f9a0b 100644
--- a/bodhi/buildsys.py
+++ b/bodhi/buildsys.py
@@ -131,13 +131,17 @@ class DevBuildsys(Buildsystem):
if 'fc7' in build:
return [{'arches': 'i386 x86_64 ppc ppc64', 'id': 10,
'locked': True,
'name': 'dist-fc7-updates-candidate',
'perm': None, 'perm_id': None},
+ {'arches': 'i386 x86_64 ppc ppc64', 'id':
10, 'locked': True,
+ 'name': 'dist-fc7-updates-testing', 'perm':
None, 'perm_id': None},
{'arches': 'i386 x86_64 ppc ppc64', 'id': 5,
'locked': True,
'name': 'dist-fc7', 'perm': None,
'perm_id': None}]
else:
return [{'arches': 'i386 x86_64 ppc ppc64', 'id': 10,
'locked': True,
'name': 'dist-f8-updates-candidate', 'perm':
None, 'perm_id': None},
{'arches': 'i386 x86_64 ppc ppc64', 'id': 5,
'locked': True,
- 'name': 'dist-f8', 'perm': None,
'perm_id': None}]
+ 'name': 'dist-f8', 'perm': None,
'perm_id': None},
+ {'arches': 'i386 x86_64 ppc ppc64', 'id': 5,
'locked': True,
+ 'name': 'dist-f8-updates-testing', 'perm':
None, 'perm_id': None}]
def listTagged(self, tag, *args, **kw):
if tag not in ('dist-rawhide', 'dist-fc7',
'dist-fc7-updates-candidate',
diff --git a/bodhi/controllers.py b/bodhi/controllers.py
index 86ec777..f2cf08a 100644
--- a/bodhi/controllers.py
+++ b/bodhi/controllers.py
@@ -657,6 +657,23 @@ class Root(controllers.RootController):
"and try again." % (build, other_build))
raise InvalidUpdateException(params)
+ # Make sure the tag has not been moved, which indicates that we
+ # are in the middle of pushing this update
+ if edited.get_implied_build_tag() not in
buildinfo[builds[0]]['tags']:
+ if edited.request:
+ flash_log("Unable to edit update. %s is currently tagged with %s
"
+ "where bodhi expects it to be %s. This most likely
means "
+ "that this update is currently being pushed." %
(
+ builds[0], buildinfo[builds[0]]['tags'],
+ edited.get_implied_build_tag()))
+ raise InvalidUpdateException(params)
+ else:
+ log.warn('Mismatched tags for an update without a
request!?')
+ log.debug(edited)
+ log.debug('Implied tag: %s\nActual tags: %s' % (
+ edited.get_implied_build_tag(),
+ buildinfo[builds[0]]['tags']))
+
edited.unpush()
# Refresh the tags for these builds
diff --git a/bodhi/model.py b/bodhi/model.py
index 3577352..2f848d9 100644
--- a/bodhi/model.py
+++ b/bodhi/model.py
@@ -617,6 +617,8 @@ class PackageUpdate(SQLObject):
tag = self.release.testing_tag
return tag
+ get_implied_build_tag = get_build_tag
+
def update_bugs(self, bugs):
"""
Create any new bugs, and remove any missing ones. Destroy removed bugs