Commit 2f5aaf45 authored by Nicolas Delaby's avatar Nicolas Delaby

To follow Url propertysheet requirements , URL should starts with a protocol

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@27925 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 14243e2b
......@@ -82,18 +82,16 @@ 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
memcached_plugin = cp.getSpecialiseValue()
if memcached_plugin is not None:
init_dict = {
'server': memcached_plugin.getUrlString(),
'server_max_key_length': memcached_plugin.getServerMaxKeyLength(),
'server_max_value_length': memcached_plugin.getServerMaxValueLength(),
}
cache_obj = DistributedRamCache(init_dict)
else:
## we don't have memcache python module installed
## thus we can't use DistributedRamCache plugin
cache_obj = None
cache_obj = None
if getattr(cp, 'getSpecialiseValue', None) is not None:
memcached_plugin = cp.getSpecialiseValue()
if memcached_plugin is not None:
init_dict = {
'server': memcached_plugin.getUrlString(),
'server_max_key_length': memcached_plugin.getServerMaxKeyLength(),
'server_max_value_length': memcached_plugin.getServerMaxValueLength(),
}
cache_obj = DistributedRamCache(init_dict)
if cache_obj is not None:
## set cache expire check interval
cache_obj.cache_expire_check_interval = cp.getCacheExpireCheckInterval()
......
......@@ -263,7 +263,7 @@ if memcache is not None:
id = "portal_memcached"
meta_type = "ERP5 Memcached Tool"
portal_type = "Memcached Tool"
security = ClassSecurityInfo()
manage_options = ({'label': 'Configure',
'action': 'memcached_tool_configure',
......@@ -282,7 +282,8 @@ if memcache is not None:
memcached_plugin = self.restrictedTraverse(plugin_path, None)
if memcached_plugin is None:
raise ValueError, 'Memcached Plugin does not exists: %r' % (plugin_path,)
dictionary = MemcachedDict((memcached_plugin.getUrlString(),),
url_string = memcached_plugin.getUrlString('')[len('memcached://'):]
dictionary = MemcachedDict((url_string,),
server_max_key_length=memcached_plugin.getServerMaxKeyLength(),
server_max_value_length=memcached_plugin.getServerMaxValueLength())
memcached_dict_pool.memcached_dict = dictionary
......
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