Commit 3e6c01cf authored by Łukasz Nowak's avatar Łukasz Nowak

slapos/slap: Stabilise connection_dict

connection_dict generated by client can be different in details from the
server side, especially it could be directly serialised to string like:

"{u'key': u'value', 'int': 1, 'empty': None}"

So pass it thorugh a way how it is treat on the server, so it would always be:

"{'key': 'value', 'int': '1', 'empty': ''}"
parent ed55169b
......@@ -44,7 +44,7 @@ from functools import wraps
import six
from .util import xml2dict
from .util import xml2dict, dict2xml
from .exception import ResourceNotReady, ServerError, NotFoundError, \
ConnectionError
from .hateoas import SlapHateoasNavigator, ConnectionHelper
......@@ -608,6 +608,8 @@ class ComputerPartition(SlapRequester):
return self._software_release_document
def setConnectionDict(self, connection_dict, slave_reference=None):
# recreate connection_dict that it would became the same as on server
connection_dict = xml2dict(dict2xml(connection_dict))
if self.getConnectionParameterDict() == connection_dict:
return
......
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