Skip to content
Snippets Groups Projects
Commit 797171f7 authored by Lauri Himanen's avatar Lauri Himanen
Browse files

Fixed issue with CacheService trying to access the value of a non-existing CacheObject.

parent ab8abff7
No related branches found
Tags
No related merge requests found
......@@ -558,12 +558,17 @@ class CacheService(object):
"""Get the value identified by name. If the cachemode does not support
getting the value, an exception is raised.
returns:
Args:
name(string): The name of the cached object to return.
raises:
Returns:
The requested object from the cache
"""
cache_object = self.get_cache_object(name)
return cache_object.value
if cache_object is None:
return None
else:
return cache_object.value
def get_cache_object(self, name):
......@@ -575,8 +580,7 @@ class CacheService(object):
def __setitem__(self, name, value):
"""Used to set the value for an item. The CacheObject corresponding to
the name has to be first created by using the function
add_cache_object().
the name has to be first dclared by using the function add().
"""
cache_object = self._cache[name]
cache_object.value = value
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment