Commit 764d1ea2 authored by Nicolas Delaby's avatar Nicolas Delaby

Use fastest way to check if memcache is installed

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@27371 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 1e66e5ed
......@@ -44,7 +44,7 @@ from Products.ERP5Type.CachePlugins.DistributedRamCache import DistributedRamCac
try:
import memcache
except ImportError:
pass
memcache = None
class CacheTool(BaseTool):
""" Caches tool wrapper for ERP5 """
......@@ -88,8 +88,8 @@ class CacheTool(BaseTool):
elif cp_meta_type == 'ERP5 Distributed Ram Cache':
## even thougn we have such plugin in ZODB that doens't mean
## we have corresponding memcache module installed
if 'memcache' in globals().keys():
cache_obj = DistributedRamCache({'server':cp.getServer()})
if memcahe is not None:
cache_obj = DistributedRamCache({'server': cp.getServer()})
else:
## we don't have memcache python module installed
## thus we can't use DistributedRamCache plugin
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment