Commit 0ae13ffb authored by Rafael Monnerat's avatar Rafael Monnerat

Implement Minimal backward compatibility for stored data

This allows reuse previous proxy.db created with XML code.
parent 1a9fda39
...@@ -39,7 +39,11 @@ def partitiondict2partition(partition): ...@@ -39,7 +39,11 @@ def partitiondict2partition(partition):
# XXX-Cedric : change from partition['xml'] to partition['json'] # XXX-Cedric : change from partition['xml'] to partition['json']
parameter_dict = dict() parameter_dict = dict()
if partition['xml']: if partition['xml']:
try:
parameter_dict = json.loads(partition['xml']) parameter_dict = json.loads(partition['xml'])
except ValueError:
# Backward compatility to old storage data.
parameter_dict = xml2dict(partition['xml'])
slap_partition['parameter_dict'] = parameter_dict slap_partition['parameter_dict'] = parameter_dict
address_list = [] address_list = []
#XXX-Cedric : I do not understand the query. It is unclear what is partition['reference'], is it computer_partition_id or partition_reference? #XXX-Cedric : I do not understand the query. It is unclear what is partition['reference'], is it computer_partition_id or partition_reference?
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment