Skip to content

Commit

Permalink
avoid memoizing the base for the cache key if the username is None
Browse files Browse the repository at this point in the history
  • Loading branch information
Juan J. Martinez committed Dec 2, 2013
1 parent 06c75ba commit 591a6d0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ftpcloudfs/fs.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ def conn(self):
def key(self, index):
"""Returns a key for a user distributed cache."""
logging.debug("cache key for %r" % [self.cffs.authurl, self.cffs.username, index])
if not hasattr(self, "_key_base"):
if not hasattr(self, "_key_base") and self.cffs.username:
self._key_base = md5("%s%s" % (self.cffs.authurl, self.cffs.username)).hexdigest()
return "%s-%s" % (self._key_base, md5(smart_str(index)).hexdigest())

Expand Down

0 comments on commit 591a6d0

Please sign in to comment.