poke at local dev memcache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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(['127.0.0.1:11211']) | |
if args.shards: | |
cache_key = get_cache_key('AUTH_test', args.container, shard='listing') | |
info = c.get(cache_key) | |
else: | |
info = c.get('container/AUTH_test/%s' % args.container) | |
print json.dumps(info, indent=2) | |
if __name__ == "__main__": | |
sys.exit(main()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment