From 319916e90e1b1f6328effbc7cd9acf74c38c1842 Mon Sep 17 00:00:00 2001 From: Rob Austein Date: Wed, 27 Apr 2016 22:20:19 +0000 Subject: First step of transition mechanism from trunk/ to tk705/: script to encapsulate all (well, we hope) relevant configuration and state from a trunk/ CA in a form we can easily load on another machine, or on the same machine after a software upgrade, or .... Transfer format is an ad hoc Python dictionary, encoded in Python's native "Pickle" format, compressed by "xz" with SHA-256 integrity checking enabled. See #807. svn path=/trunk/; revision=6395 --- potpourri/ca-unpickle.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 potpourri/ca-unpickle.py (limited to 'potpourri/ca-unpickle.py') diff --git a/potpourri/ca-unpickle.py b/potpourri/ca-unpickle.py new file mode 100755 index 00000000..dbbe3e8a --- /dev/null +++ b/potpourri/ca-unpickle.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python + +# $Id$ + +""" +Unpickle CA state packaged by ca-pickle. + +This version is a stub, and exists only to test ca-pickle. +""" + +import sys +import cPickle +import argparse +import subprocess + +parser = argparse.ArgumentParser(description = __doc__) +parser.add_argument("input", help = "input file") +args = parser.parse_args() + +xzcat = subprocess.Popen(("xzcat", args.input), stdout = subprocess.PIPE) +world = cPickle.load(xzcat.stdout) +if xzcat.wait() != 0: + sys.exit("XZ unpickling failed with code {}".format(xz.returncode)) + +print "import datetime" +print "world =", repr(world) -- cgit v1.2.3