Add backward compatibility about Partition.getInstanceGuid().

Old versions of slapproxy/slapos master don't know it.
Catching it here so that we have a chance to debug problems in SRs.
parent f3c4c3f2
......@@ -127,9 +127,13 @@ class Recipe(object):
return_parameter_dict = self._getReturnParameterDict(self.instance,
return_parameters)
if not slave:
options['instance-guid'] = self.instance.getInstanceGuid()
# XXX: deprecated, to be removed
options['instance_guid'] = self.instance.getInstanceGuid()
try:
options['instance-guid'] = self.instance.getInstanceGuid()
# XXX: deprecated, to be removed
options['instance_guid'] = self.instance.getInstanceGuid()
except slapmodule.ResourceNotReady:
# Backward compatibility. Old SlapOS masters don't know this.
self.logger.warning("Impossible to fetch instance GUID.")
except (slapmodule.NotFoundError, slapmodule.ServerError, slapmodule.ResourceNotReady) as exc:
self._raise_request_exception = exc
self._raise_request_exception_formatted = traceback.format_exc()
......
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