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):
# Note: SlapOS Master does not support it for slave instances
if not slave:
try:
options['instance-guid'] = self.instance.getInstanceGuid()
options['instance-guid'] = self.instance.getInstanceGuid() \
.encode('UTF-8')
# 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-status'] = self.instance.getStatus()
except (slapmodule.ResourceNotReady, AttributeError):
......
......@@ -155,7 +155,8 @@ class Recipe(object):
'UNKNOWN Instance').encode('UTF-8')
options['root-instance-title'] = parameter_dict.pop('root_instance_title',
'UNKNOWN').encode('UTF-8')
options['instance-guid'] = computer_partition.getInstanceGuid()
options['instance-guid'] = computer_partition.getInstanceGuid() \
.encode('UTF-8')
ipv4_set = set()
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