Skip to content

Instantly share code, notes, and snippets.

Created November 17, 2020 23:26
What would you like to do?
poke at local dev memcache
#!/usr/bin/env python
from argparse import ArgumentParser
import json
from swift.common.memcached import MemcacheRing
from swift.proxy.controllers.base import get_cache_key
import sys
parser = ArgumentParser()
parser.add_argument('container', help='Name of container to check')
parser.add_argument('--shards', action='store_true', help='do shards instead')
def main():
args = parser.parse_args()
c = MemcacheRing([''])
if args.shards:
cache_key = get_cache_key('AUTH_test', args.container, shard='listing')
info = c.get(cache_key)
info = c.get('container/AUTH_test/%s' % args.container)
print json.dumps(info, indent=2)
if __name__ == "__main__":
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment