Skip to content

Instantly share code, notes, and snippets.

@andrewsmedina
Forked from tarsisazevedo/migrate_cname.py
Created September 23, 2014 15:35
Show Gist options
  • Save andrewsmedina/18c15ce983573387dbe8 to your computer and use it in GitHub Desktop.
Save andrewsmedina/18c15ce983573387dbe8 to your computer and use it in GitHub Desktop.
import redis, os
HOST = os.getenv("HOST", "localhost")
PORT = os.getenv("PORT", 6379)
r = redis.StrictRedis(host=HOST, port=PORT)
cnames_app = r.get("cname*")
for cname_app in cnames_app:
cname = r.get(cname_app)
r.delete(cname_app)
r.lpush(cname_app, cname)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment