Only split url arg with memcache backend

Only split the url arg with the memcache backend, the list form breaks
the redis backend driver / library.

Change-Id: Id0e1d9351a92ba862e48f088ff15d1f77b6105d9
Closes-Bug: #1801967
(cherry picked from commit 356cdc13b6)
This commit is contained in:
Morgan Fainberg 2018-11-06 11:30:55 -08:00 committed by Ben Nemec
parent df3ac080b8
commit 5f42092e2c
1 changed files with 11 additions and 1 deletions

View File

@ -120,7 +120,17 @@ def _build_cache_config(conf):
continue
arg_key = '.'.join([prefix, 'arguments', argname])
if argname == 'url':
# NOTE(morgan): The handling of the URL data in memcache is bad and
# only takes cases where the values are a list. This explicitly
# checks for the base dogpile.cache.memcached backend and does the
# split if needed. Other backends such as redis get the same
# previous behavior. Overall the fact that the backends opaquely
# take data and do not handle processing/validation as expected
# directly makes for odd behaviors when wrapping dogpile.cache in
# a library like oslo.cache
if (conf.cache.backend
in ('dogpile.cache.memcached', 'oslo_cache.memcache_pool')
and argname == 'url'):
argvalue = argvalue.split(',')
conf_dict[arg_key] = argvalue