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): ...@@ -82,18 +82,16 @@ class CacheTool(BaseTool):
elif cp_meta_type == 'ERP5 Distributed Ram Cache': elif cp_meta_type == 'ERP5 Distributed Ram Cache':
## even thougn we have such plugin in ZODB that doens't mean ## even thougn we have such plugin in ZODB that doens't mean
## we have corresponding memcache module installed ## we have corresponding memcache module installed
memcached_plugin = cp.getSpecialiseValue() cache_obj = None
if memcached_plugin is not None: if getattr(cp, 'getSpecialiseValue', None) is not None:
init_dict = { memcached_plugin = cp.getSpecialiseValue()
'server': memcached_plugin.getUrlString(), if memcached_plugin is not None:
'server_max_key_length': memcached_plugin.getServerMaxKeyLength(), init_dict = {
'server_max_value_length': memcached_plugin.getServerMaxValueLength(), 'server': memcached_plugin.getUrlString(),
} 'server_max_key_length': memcached_plugin.getServerMaxKeyLength(),
cache_obj = DistributedRamCache(init_dict) 'server_max_value_length': memcached_plugin.getServerMaxValueLength(),
else: }
## we don't have memcache python module installed cache_obj = DistributedRamCache(init_dict)
## thus we can't use DistributedRamCache plugin
cache_obj = None
if cache_obj is not None: if cache_obj is not None:
## set cache expire check interval ## set cache expire check interval
cache_obj.cache_expire_check_interval = cp.getCacheExpireCheckInterval() cache_obj.cache_expire_check_interval = cp.getCacheExpireCheckInterval()
......
...@@ -263,7 +263,7 @@ if memcache is not None: ...@@ -263,7 +263,7 @@ if memcache is not None:
id = "portal_memcached" id = "portal_memcached"
meta_type = "ERP5 Memcached Tool" meta_type = "ERP5 Memcached Tool"
portal_type = "Memcached Tool" portal_type = "Memcached Tool"
security = ClassSecurityInfo() security = ClassSecurityInfo()
manage_options = ({'label': 'Configure', manage_options = ({'label': 'Configure',
'action': 'memcached_tool_configure', 'action': 'memcached_tool_configure',
...@@ -282,7 +282,8 @@ if memcache is not None: ...@@ -282,7 +282,8 @@ if memcache is not None:
memcached_plugin = self.restrictedTraverse(plugin_path, None) memcached_plugin = self.restrictedTraverse(plugin_path, None)
if memcached_plugin is None: if memcached_plugin is None:
raise ValueError, 'Memcached Plugin does not exists: %r' % (plugin_path,) 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_key_length=memcached_plugin.getServerMaxKeyLength(),
server_max_value_length=memcached_plugin.getServerMaxValueLength()) server_max_value_length=memcached_plugin.getServerMaxValueLength())
memcached_dict_pool.memcached_dict = dictionary 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