From 60e3cc39d4120028c39ee94d0af82a9149eb922c Mon Sep 17 00:00:00 2001 From: Rob Austein Date: Thu, 28 Apr 2016 18:59:12 +0000 Subject: Truncate pickle file before rewriting it, to keep Python from being confused by old data if we update in place. Use shorter names in the top-level dict to remove visual clutter in unpickling code. svn path=/trunk/; revision=6401 --- potpourri/ca-pickle.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/potpourri/ca-pickle.py b/potpourri/ca-pickle.py index 5b88f3f9..aefdade5 100755 --- a/potpourri/ca-pickle.py +++ b/potpourri/ca-pickle.py @@ -82,17 +82,17 @@ for filename in filenames: files[filename] = f.read() world = dict( - version = rpki.version.VERSION, - rpki_conf = filenames[0], - databases = databases, - files = files, - raw_config = raw_config, - cooked_config = cooked_config) + VERSION = rpki.version.VERSION, + RPKI_CONF = filenames[0], + db = databases, + file = files, + raw = raw_config, + cfg = cooked_config) xz = subprocess.Popen( ("xz", "-C", "sha256"), stdin = subprocess.PIPE, - stdout = os.open(args.output, os.O_WRONLY | os.O_CREAT, 0600)) + stdout = os.open(args.output, os.O_WRONLY | os.O_CREAT | os.O_TRUNC, 0600)) cPickle.dump(world, xz.stdin, args.protocol) -- cgit v1.2.3