Commit e5f5d4f4 by Őry Máté

vm: support save_as with custom template name

parent 73c6938b
...@@ -289,7 +289,7 @@ class SaveAsTemplateOperation(InstanceOperation): ...@@ -289,7 +289,7 @@ class SaveAsTemplateOperation(InstanceOperation):
v = 1 v = 1
return "%s v%d" % (name, v) return "%s v%d" % (name, v)
def _operation(self, activity, user, system, timeout=300, def _operation(self, activity, user, system, timeout=300, name=None,
with_shutdown=True, **kwargs): with_shutdown=True, **kwargs):
if with_shutdown: if with_shutdown:
try: try:
...@@ -306,7 +306,7 @@ class SaveAsTemplateOperation(InstanceOperation): ...@@ -306,7 +306,7 @@ class SaveAsTemplateOperation(InstanceOperation):
'description': self.instance.description, 'description': self.instance.description,
'lease': self.instance.lease, # Can be problem in new VM 'lease': self.instance.lease, # Can be problem in new VM
'max_ram_size': self.instance.max_ram_size, 'max_ram_size': self.instance.max_ram_size,
'name': self._rename(self.instance.name), 'name': name or self._rename(self.instance.name),
'num_cores': self.instance.num_cores, 'num_cores': self.instance.num_cores,
'owner': user, 'owner': user,
'parent': self.instance.template, # Can be problem 'parent': self.instance.template, # Can be problem
......
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 sign in to comment