Commit 360b0cf4 authored by Julien Muchembled's avatar Julien Muchembled

Cast 'instance-guid' to str, in order to avoid escaped syntax (!py!)

In the case of hellorina SR, the following section generated invalid command:

[proxy]
command-line = {{ python_location }}/bin/python2.7 {{ rina_proxy }} ${server:instance-guid} ${:ipv6} ${:port}
...
parent daf31d66
...@@ -160,9 +160,10 @@ class Recipe(object): ...@@ -160,9 +160,10 @@ class Recipe(object):
# Note: SlapOS Master does not support it for slave instances # Note: SlapOS Master does not support it for slave instances
if not slave: if not slave:
try: try:
options['instance-guid'] = self.instance.getInstanceGuid() options['instance-guid'] = self.instance.getInstanceGuid() \
.encode('UTF-8')
# XXX: deprecated, to be removed # XXX: deprecated, to be removed
options['instance_guid'] = self.instance.getInstanceGuid() options['instance_guid'] = options['instance-guid']
options['instance-state'] = self.instance.getState() options['instance-state'] = self.instance.getState()
options['instance-status'] = self.instance.getStatus() options['instance-status'] = self.instance.getStatus()
except (slapmodule.ResourceNotReady, AttributeError): except (slapmodule.ResourceNotReady, AttributeError):
......
...@@ -155,7 +155,8 @@ class Recipe(object): ...@@ -155,7 +155,8 @@ class Recipe(object):
'UNKNOWN Instance').encode('UTF-8') 'UNKNOWN Instance').encode('UTF-8')
options['root-instance-title'] = parameter_dict.pop('root_instance_title', options['root-instance-title'] = parameter_dict.pop('root_instance_title',
'UNKNOWN').encode('UTF-8') 'UNKNOWN').encode('UTF-8')
options['instance-guid'] = computer_partition.getInstanceGuid() options['instance-guid'] = computer_partition.getInstanceGuid() \
.encode('UTF-8')
ipv4_set = set() ipv4_set = set()
v4_add = ipv4_set.add v4_add = ipv4_set.add
......
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