apache/bodhi.conf | 4 ++--
bodhi/controllers.py | 21 +++++++++++++++++----
2 files changed, 19 insertions(+), 6 deletions(-)
New commits:
commit 8e55587060717f69584589ec7f6b50bad444a1c4
Author: Luke Macken <lmacken(a)redhat.com>
Date: Fri Aug 8 10:52:27 2008 -0400
Change our WSGISocketPrefix to make SELinux happy
diff --git a/apache/bodhi.conf b/apache/bodhi.conf
index b5a4e7b..0c126d3 100644
--- a/apache/bodhi.conf
+++ b/apache/bodhi.conf
@@ -1,7 +1,7 @@
Alias /updates/static /usr/share/bodhi/static
WSGIDaemonProcess bodhi user=apache processes=4 threads=2 maximum-requests=1000
display-name=bodhi
-WSGISocketPrefix /tmp/wsgi
+WSGISocketPrefix run/wsgi
WSGIRestrictStdout On
WSGIRestrictSignal Off
WSGIPythonOptimize 2
commit e37a81df5579fdf8e8ffd3534de23b19dbeb47c4
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue Aug 5 21:31:54 2008 -0400
Add some more sanity checks to the beginning of save()
diff --git a/bodhi/controllers.py b/bodhi/controllers.py
index 6c13b5b..b4f295b 100644
--- a/bodhi/controllers.py
+++ b/bodhi/controllers.py
@@ -385,7 +385,7 @@ class Root(controllers.RootController):
@validate(form=update_form)
@identity.require(identity.not_anonymous())
def save(self, builds, type_, notes, bugs, close_bugs=False, edited=False,
- request='testing', suggest_reboot=False, inheritance=False,
+ request='testing', suggest_reboot=False, inheritance=False,
autokarma=True, stable_karma=3, unstable_karma=-3, **kw):
""" Save an update.
@@ -429,6 +429,16 @@ class Root(controllers.RootController):
if not bugs: bugs = []
koji = buildsys.get_session()
+ # Basic sanity checks
+ if type_ not in config.get('update_types'):
+ flash_log('Unknown update type: %s. Valid types are: %s' % (
+ type_, config.get('update_types')))
+ return dict()
+ if request not in ('testing', 'stable', 'None', None):
+ flash_log('Unknown request: %s. Valid requests are: testing, '
+ 'stable, None' % request)
+ return dict()
+
# Parameters used to re-populate the update form if something fails
params = {
'builds.text' : ' '.join(builds),
@@ -447,9 +457,12 @@ class Root(controllers.RootController):
for build in builds:
try:
b = PackageBuild.byNvr(build)
- flash_log("%s update already exists!" %
- link(build, b.get_url()))
- if request_format() == 'json': return dict()
+ if request_format() == 'json':
+ flash_log("%s update already exists!" % build)
+ return dict()
+ else:
+ flash_log("%s update already exists!" %
+ link(build, b.get_url()))
raise redirect('/new', **params)
except SQLObjectNotFound:
pass
commit 5dd6c3fd9f1a7899e5915f1ed242180afce2654e
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue Aug 5 21:04:29 2008 -0400
As it turns out, 'inactivity-timeout' was a bad idea.
diff --git a/apache/bodhi.conf b/apache/bodhi.conf
index a3db7e1..b5a4e7b 100644
--- a/apache/bodhi.conf
+++ b/apache/bodhi.conf
@@ -1,6 +1,6 @@
Alias /updates/static /usr/share/bodhi/static
-WSGIDaemonProcess bodhi user=apache processes=4 threads=2 maximum-requests=1000
display-name=bodhi inactivity-timeout=30
+WSGIDaemonProcess bodhi user=apache processes=4 threads=2 maximum-requests=1000
display-name=bodhi
WSGISocketPrefix /tmp/wsgi
WSGIRestrictStdout On
WSGIRestrictSignal Off
Show replies by date