Commit e5d0f65c authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_crm: include_message as optional on the return

This makes the ease to get the message, on certain special cases.
parent 2ef87b68
...@@ -9,6 +9,8 @@ if context.getAggregateValue(portal_type="Computer Partition") is not None: ...@@ -9,6 +9,8 @@ if context.getAggregateValue(portal_type="Computer Partition") is not None:
try: try:
d = memcached_dict[context.getReference()] d = memcached_dict[context.getReference()]
except KeyError: except KeyError:
if include_message:
return "Not possible to connect"
return return
d = json.loads(d) d = json.loads(d)
...@@ -17,8 +19,11 @@ if context.getAggregateValue(portal_type="Computer Partition") is not None: ...@@ -17,8 +19,11 @@ if context.getAggregateValue(portal_type="Computer Partition") is not None:
# Optimise by checking memcache information first. # Optimise by checking memcache information first.
if result.startswith('#error '): if result.startswith('#error '):
return last_contact return result
# XXX time limit of 48 hours for run at least once. # XXX time limit of 48 hours for run at least once.
if include_message:
return result
return None return None
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string></string> </value> <value> <string>include_message=False</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
......
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