Commit 0ae0045c authored by Sigmund Augdal's avatar Sigmund Augdal

Added util scripts to back up and restore data from etcd

parent be6d8fbe
import etcd
import json
import sys
etcd = etcd.Etcd("158.38.213.3", 4001, ssl_cert="etcd_client.crt", ssl_key="etcd_client.key", verify="etcd_ca.crt")
def dump_subtree(etcd, tree, dump):
for entry in etcd.list(tree):
if entry.dir:
dump_subtree(etcd, entry.key, dump)
else:
dump[entry.key] = entry.value
data = {}
dump_subtree(etcd, "/nova", data)
json.dump(data, sys.stdout)
import etcd
import json
import sys
etcd = etcd.Etcd("158.38.213.2", 4001, ssl_cert="etcd_client.crt", ssl_key="etcd_client.key", verify="etcd_ca.crt")
data = json.load(sys.stdin)
for key, value in data.items():
etcd.set(key, value)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment