Commit 10d32071 authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_cloud: Let rename reset Last Data

  Move to workflow tranistion the duty of reset/set last data, so it work regardless of slaptool.
parent 86c25ca7
......@@ -29,4 +29,12 @@ if len(request_software_instance_list) == 1:
raise ValueError, "Too many instances '%s' found: %s" % (software_title, [x.path for x in request_software_instance_list])
# Change the title
previous_title = instance.getTitle()
instance.edit(title=software_title, activate_kw={'tag': tag})
# Ensure that the latest date is reset for both new and old instance
hosting = instance.getSpecialise()
for name in [previous_title, software_title]:
# reset request cache
key = '_'.join([hosting, name])
instance.setLastData({}, key=key)
......@@ -52,6 +52,12 @@
<key> <string>_params</string> </key>
<value> <string>state_change</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>script_RequestedInstance_rename</string> </value>
......
......@@ -861,11 +861,7 @@ class SlapTool(BaseTool):
software_instance = self._getSoftwareInstanceForComputePartition(
compute_node_id, compute_partition_id,
slave_reference)
hosting = software_instance.getSpecialise()
for name in [software_instance.getTitle(), new_name]:
# reset request cache
key = '_'.join([hosting, name])
software_instance.setLastData({}, key=key)
return software_instance.rename(new_name=new_name,
comment="Rename %s into %s" % (software_instance.title, new_name))
......
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