From e035f83edf5271d6438213ddb4524ac99012d2a6 Mon Sep 17 00:00:00 2001 From: Anders Ingemann Date: Sun, 25 Jan 2015 20:00:57 +0100 Subject: [PATCH] Fix problem when (de-)serializing bootstrapinfo twice --- bootstrapvz/base/bootstrapinfo.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bootstrapvz/base/bootstrapinfo.py b/bootstrapvz/base/bootstrapinfo.py index 9162b62..f5dc0bc 100644 --- a/bootstrapvz/base/bootstrapinfo.py +++ b/bootstrapvz/base/bootstrapinfo.py @@ -118,7 +118,10 @@ class BootstrapInformation(object): state = self.__dict__.copy() exclude_keys = ['source_lists', 'preference_lists', 'packages'] for key in exclude_keys: - del state[key] + # We may have been serialized before, + # so don't fail if the keys do not exist + if key in state: + del state[key] state['__class__'] = self.__module__ + '.' + self.__class__.__name__ return state