Created
September 23, 2014 16:01
-
-
Save jblancett/354672866c5bd0bafc71 to your computer and use it in GitHub Desktop.
migrate cname in redis from tsuru 0.6.2 to 0.7.0
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
import redis, os | |
HOST = os.getenv("HOST", "localhost") | |
PORT = os.getenv("PORT", 6379) | |
r = redis.StrictRedis(host=HOST, port=PORT) | |
cnames_app = r.keys("cname:*") | |
for cname_app in cnames_app: | |
cname = r.get(cname_app) | |
r.delete(cname_app) | |
r.lpush(cname_app, cname) | |
print "converted %s to list" % cname_app |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment