Return-Path: X-Original-To: apmail-incubator-allura-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-allura-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 67AA1D41C for ; Fri, 26 Oct 2012 19:33:23 +0000 (UTC) Received: (qmail 87584 invoked by uid 500); 26 Oct 2012 19:33:23 -0000 Delivered-To: apmail-incubator-allura-commits-archive@incubator.apache.org Received: (qmail 87533 invoked by uid 500); 26 Oct 2012 19:33:23 -0000 Mailing-List: contact allura-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: allura-dev@incubator.apache.org Delivered-To: mailing list allura-commits@incubator.apache.org Received: (qmail 87147 invoked by uid 99); 26 Oct 2012 19:33:22 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 26 Oct 2012 19:33:22 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 5DFC84FFA1; Fri, 26 Oct 2012 19:33:22 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: johnsca@apache.org To: allura-commits@incubator.apache.org X-Mailer: ASF-Git Admin Mailer Subject: [22/26] git commit: [#5107] fix error handling text around jinja BytecodeCache handling Message-Id: <20121026193322.5DFC84FFA1@tyr.zones.apache.org> Date: Fri, 26 Oct 2012 19:33:22 +0000 (UTC) [#5107] fix error handling text around jinja BytecodeCache handling Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/01039d8a Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/01039d8a Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/01039d8a Branch: refs/heads/cj/4942 Commit: 01039d8a28e6e88f426132d1c0af75aa55dfaffe Parents: f88173a Author: Dave Brondsema Authored: Mon Oct 15 18:53:27 2012 +0000 Committer: Dave Brondsema Committed: Mon Oct 15 18:53:27 2012 +0000 ---------------------------------------------------------------------- Allura/allura/config/app_cfg.py | 20 ++++++-------------- 1 files changed, 6 insertions(+), 14 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/01039d8a/Allura/allura/config/app_cfg.py ---------------------------------------------------------------------- diff --git a/Allura/allura/config/app_cfg.py b/Allura/allura/config/app_cfg.py index aef1e6c..428c339 100644 --- a/Allura/allura/config/app_cfg.py +++ b/Allura/allura/config/app_cfg.py @@ -58,26 +58,18 @@ class ForgeConfig(AppConfig): def _setup_bytecode_cache(self): cache_type = config.get('jinja_bytecode_cache_type') bcc = None - if cache_type == 'memcached' and config.get('memcached_host'): - try: + try: + if cache_type == 'memcached' and config.get('memcached_host'): import pylibmc from jinja2 import MemcachedBytecodeCache client = pylibmc.Client([config['memcached_host']]) bcc = MemcachedBytecodeCache(client) - except: - log.exception("Error encountered while setting up a" + - " filesystem-backed bytecode cache for Jinja.") - elif cache_type == 'filesystem': - try: + elif cache_type == 'filesystem': from jinja2 import FileSystemBytecodeCache bcc = FileSystemBytecodeCache() - except ImportError: - log.exception("pylibmc is a required dependency when" + - " using a memcached-backed bytecode cache for" + - " Jinja") - except: - log.exception("Error encountered while setting up a" + - " memcached-backed bytecode cache for Jinja") + except: + log.exception("Error encountered while setting up a" + + " %s-backed bytecode cache for Jinja" % cache_type) return bcc def setup_jinja_renderer(self):