bodhi/__init__.py | 2 -
bodhi/controllers.py | 64 ++++++++++++++++++++++++-----------------------
bodhi/templates/form.kid | 18 -------------
bodhi/util.py | 6 ++--
4 files changed, 38 insertions(+), 52 deletions(-)
New commits:
commit 725efbb64fc15c5fb933e4f16a06771f2ea7279d
Author: Luke Macken <lmacken(a)redhat.com>
Date: Fri Aug 22 12:31:10 2008 -0400
Put the full update url into bugzilla comments
diff --git a/bodhi/controllers.py b/bodhi/controllers.py
index 37134fc..744f504 100644
--- a/bodhi/controllers.py
+++ b/bodhi/controllers.py
@@ -379,6 +379,7 @@ class Root(controllers.RootController):
'autokarma' : update.builds[0].package.stable_karma != 0 and
update.builds[0].package.unstable_karma != 0,
}
+ log.debug("values = %s" % values)
if update.status == 'testing':
flash("Editing this update will move it back to a pending state.")
return dict(form=update_form, values=values, action=url("/save"),
@@ -684,7 +685,8 @@ class Root(controllers.RootController):
# Add/remove the necessary Bugzillas
try:
update.update_bugs(bugs)
- except xmlrpclib.Fault:
+ except xmlrpclib.Fault, f:
+ log.exception(f)
note.insert(0, "Unable to access one or more bugs")
# If there are any security bugs, make sure this update is
@@ -713,7 +715,7 @@ class Root(controllers.RootController):
bug.add_comment(update,
"%s has been submitted as an update for %s.\n%s" %
(update.title, release.long_name,
- url(update.get_url())))
+ config.get('base_address') +
url(update.get_url())))
# If a request is specified, make it. By default we're submitting
# new updates directly into testing
commit 1c884253d66c168d81c600307e64e4c18700a31b
Author: Luke Macken <lmacken(a)redhat.com>
Date: Fri Aug 22 12:25:46 2008 -0400
Fix a bug in bodhi.util.make_update_link
diff --git a/bodhi/util.py b/bodhi/util.py
index 34efc3d..d618c46 100644
--- a/bodhi/util.py
+++ b/bodhi/util.py
@@ -129,12 +129,12 @@ def authorized_user(update, identity):
def make_update_link(obj):
""" Return a link Element for a given PackageUpdate or PackageBuild
"""
update = None
- if hasattr(obj, 'get_url'): # PackageUpdate
+ if hasattr(obj, 'updates'): # Package or PackageBuild
+ update = obj.updates[0]
+ elif hasattr(obj, 'get_url'): # PackageUpdate
update = obj
elif hasattr(obj, 'update'): # Comment
update = obj.update
- elif hasattr(obj, 'updates'): # Package
- update = obj.updates[0]
else:
log.error("Unknown parameter make_update_link(%s)" % obj)
return None
commit e2f7fbba21bd6234668cbd82d9700b29a0d477eb
Author: Luke Macken <lmacken(a)redhat.com>
Date: Fri Aug 22 12:25:32 2008 -0400
Disable our fancy obsoletion dialog, as it is not really that useful anymore
diff --git a/bodhi/controllers.py b/bodhi/controllers.py
index 6cd08de..37134fc 100644
--- a/bodhi/controllers.py
+++ b/bodhi/controllers.py
@@ -947,35 +947,35 @@ class Root(controllers.RootController):
raise redirect(update.get_url())
return dict(form=self.ok_cancel_form, nvr=nvr)
- @expose(template='bodhi.templates.obsolete')
- def obsolete_dialog(self, update):
- from bodhi.widgets import ObsoleteForm
- package = Package.byName('-'.join(update.split('-')[:-2]))
- builds = filter(lambda x: x.updates[0].status in ('testing',
'pending'),
- package.builds)
- if not len(builds):
- return dict(dialog=None)
- return dict(dialog=ObsoleteForm(builds))
-
- @expose("json")
- def obsolete(self, updates, *args, **kw):
- """
- Called by our ObsoleteForm widget. This method will
- request that any specified updates be marked as obsolete
- """
- log.debug("obsolete(%s, %s, %s)" % (updates, args, kw))
- errors = []
- if type(updates) != list:
- updates = [updates]
- for update in updates:
- up = PackageBuild.byNvr(update).update[0]
- if not util.authorized_user(up, identity):
- msg = "Unauthorized to obsolete %s" % up.title
- errors.append(msg)
- flash_log(msg)
- else:
- up.obsolete()
- return len(errors) and errors[0] or "Done!"
+ #(a)expose(template='bodhi.templates.obsolete')
+ #def obsolete_dialog(self, update):
+ # from bodhi.widgets import ObsoleteForm
+ # package = Package.byName('-'.join(update.split('-')[:-2]))
+ # builds = filter(lambda x: x.updates[0].status in ('testing',
'pending'),
+ # package.builds)
+ # if not len(builds):
+ # return dict(dialog=None)
+ # return dict(dialog=ObsoleteForm(builds))
+
+ #@expose("json")
+ #def obsolete(self, updates, *args, **kw):
+ # """
+ # Called by our ObsoleteForm widget. This method will
+ # request that any specified updates be marked as obsolete
+ # """
+ # log.debug("obsolete(%s, %s, %s)" % (updates, args, kw))
+ # errors = []
+ # if type(updates) != list:
+ # updates = [updates]
+ # for update in updates:
+ # up = PackageBuild.byNvr(update).update[0]
+ # if not util.authorized_user(up, identity):
+ # msg = "Unauthorized to obsolete %s" % up.title
+ # errors.append(msg)
+ # flash_log(msg)
+ # else:
+ # up.obsolete()
+ # return len(errors) and errors[0] or "Done!"
@expose(allow_json=True)
def dist_tags(self):
diff --git a/bodhi/templates/form.kid b/bodhi/templates/form.kid
index 6ef8879..96c65b3 100644
--- a/bodhi/templates/form.kid
+++ b/bodhi/templates/form.kid
@@ -4,27 +4,11 @@
<head>
<meta content="text/html; charset=UTF-8"
http-equiv="content-type" py:replace="''"/>
-
- /*
- ** If we're flashing a broken update path error message, then display
- ** the obsolete dialog.
- */
- <script type="text/javascript">
- $(document).ready(function() {
- if( $('div.flash').text().substring(18, 0) == "Broken update
path" ){
-
$('#obsolete_dialog').load('/updates/obsolete_dialog?update=' +
-
$('#form_builds_text').val().split()[0]);
- }
- })
- </script>
-
<title py:content="title" />
</head>
-
-<body class="flora">
- <div id="obsolete_dialog" class="obsolete_dialog" />
+<body>
<div>
<table class="show" cellpadding="0"
cellspacing="0">
<tr>
commit b2dcc64acf00d46051b97da1960188c0fc3279ae
Author: Luke Macken <lmacken(a)redhat.com>
Date: Thu Aug 21 18:46:57 2008 -0400
Cut the hostname down to the name only
diff --git a/bodhi/__init__.py b/bodhi/__init__.py
index dcf96e8..c9642e7 100644
--- a/bodhi/__init__.py
+++ b/bodhi/__init__.py
@@ -1,5 +1,5 @@
import socket
-hostname = socket.gethostname()
+hostname = socket.gethostname().split('.')[0]
from bodhi.release import VERSION as version