mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-24 15:36:27 +00:00
Fix problem when (de-)serializing bootstrapinfo twice
This commit is contained in:
parent
3c642e0b02
commit
e035f83edf
1 changed files with 4 additions and 1 deletions
|
@ -118,7 +118,10 @@ class BootstrapInformation(object):
|
||||||
state = self.__dict__.copy()
|
state = self.__dict__.copy()
|
||||||
exclude_keys = ['source_lists', 'preference_lists', 'packages']
|
exclude_keys = ['source_lists', 'preference_lists', 'packages']
|
||||||
for key in exclude_keys:
|
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__
|
state['__class__'] = self.__module__ + '.' + self.__class__.__name__
|
||||||
return state
|
return state
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue