Skip to content

Instantly share code, notes, and snippets.

@monsterxx03
Created July 1, 2014 03:22
Show Gist options
  • Save monsterxx03/3081d45ded8ac7649427 to your computer and use it in GitHub Desktop.
Save monsterxx03/3081d45ded8ac7649427 to your computer and use it in GitHub Desktop.
get value from memcache based on keystone's token id
# need install dogpile.cache
from hashlib import sha1
token_id = "b7e3119430214967ae34695bab783b08"
key = sha1("token-" + token_id).hexdigest()
c = memcache.Client([“127.0.0.1:11211”])
value = c.get(memcache_key)
print value
"""
telnet 127.0.0.1 11211
get {memcache_key}
"""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment