bodhi/controllers.py
by Luke Macken
bodhi/controllers.py | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
New commits:
commit ee69e5b0caff5845cb5ba889599787d7f8c2298b
Author: Ricky Zhou <ricky(a)fedoraproject.org>
Date: Tue Aug 4 11:50:09 2009 -0400
Wrap bodhi comments.
diff --git a/bodhi/controllers.py b/bodhi/controllers.py
index dab5c90..03c5bbd 100644
--- a/bodhi/controllers.py
+++ b/bodhi/controllers.py
@@ -19,6 +19,7 @@ import time
import logging
import cherrypy
import xmlrpclib
+import textwrap
from cgi import escape
from koji import GenericError
@@ -998,7 +999,11 @@ class Root(controllers.RootController):
return dict(update=update, updates=[],
values={'title' : update.title},
comment_form=self.comment_captcha_form)
- if text == 'None': text = None
+ if text == 'None':
+ text = None
+ else:
+ text = textwrap.TextWrapper(width=80,
+ break_long_words=False).fill(text)
update.comment(text, karma, author=author, anonymous=True)
raise redirect(update.get_url())
@@ -1027,7 +1032,11 @@ class Root(controllers.RootController):
else:
try:
update = PackageUpdate.byTitle(title)
- if text == 'None': text = None
+ if text == 'None':
+ text = None
+ else:
+ text = textwrap.TextWrapper(width=80,
+ break_long_words=False).fill(text)
update.comment(text, karma)
if request_format() == 'json':
return dict(update=unicode(update))
14 years, 9 months
bodhi/buildsys.py
by Luke Macken
bodhi/buildsys.py | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
New commits:
commit da86a7a44fecb097ee1ffc40ba9614a04594cd31
Author: Luke Macken <lmacken(a)redhat.com>
Date: Mon Aug 3 21:41:43 2009 -0400
Modify our buildsystem.get_session to return a new instance every time.
This change moves the original method, which returns a "singleton", to
buildsys._get_session. This change should hopefully mitigate problems like
this in production:
File "/usr/lib/python2.4/site-packages/bodhi/model.py", line 207, in get_latest
builds = koji_session.getLatestBuilds(tag, None, self.package.name)
File "/usr/lib/python2.4/site-packages/koji/__init__.py", line 1255, in __call__
return self.__func(self.__name,args,opts)
File "/usr/lib/python2.4/site-packages/koji/__init__.py", line 1501, in _callMethod
raise err
AuthError: Invalid session or bad credentials
diff --git a/bodhi/buildsys.py b/bodhi/buildsys.py
index cc2d750..c8a6dd6 100644
--- a/bodhi/buildsys.py
+++ b/bodhi/buildsys.py
@@ -175,10 +175,22 @@ def koji_login(client=None, clientca=None, serverca=None):
koji_session.ssl_login(client, clientca, serverca)
return koji_session
-
def get_session():
+ """ Get a new buildsystem instance """
+ session = None
+ buildsys = config.get('buildsystem')
+ if buildsys == 'koji':
+ session = koji_login()
+ elif buildsys == 'dev':
+ session = DevBuildsys()
+ return session
+
+def _get_session():
"""
Get our buildsystem instance.
+
+ :deprecated: This returns a "singleton" instance, but seems to
+ cause some issues in production.
"""
global session
if not session:
14 years, 9 months