aboutsummaryrefslogtreecommitdiff
path: root/potpourri
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2016-04-28 18:59:12 +0000
committerRob Austein <sra@hactrn.net>2016-04-28 18:59:12 +0000
commit60e3cc39d4120028c39ee94d0af82a9149eb922c (patch)
tree61ab5df5e6571d7a1be3770dc3e039fd867148f6 /potpourri
parent002c58cac7309379912c440c0df068c92d70b477 (diff)
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
Diffstat (limited to 'potpourri')
-rwxr-xr-xpotpourri/ca-pickle.py14
1 files 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)