Refactoring save as function
-
✅ add InstanceTemplate.save_as/_async -
✅ #24 (closed) create disk from iso url -
✅ add Disk.create (replace all Disk.objects.create and Disk.init calls) -
✅ add Disk.create_empty
{{ resolvedDiscussionCount }}/{{ discussionCount }} {{ resolvedCountText }} resolved
-
65 65 TYPES = [('qcow2-norm', 'qcow2 normal'), ('qcow2-snap', 'qcow2 snapshot'), 66 66 ('iso', 'iso'), ('raw-ro', 'raw read-only'), ('raw-rw', 'raw')] 67 67 name = CharField(blank=True, max_length=100, verbose_name=_("name")) 68 filename = CharField(max_length=256, verbose_name=_("filename")) 68 filename = CharField(max_length=256, unique=True, -
403 393 local_tasks.restore.apply_async(args=[self, user], 404 394 queue='localhost.man') 405 395 406 def save_as(self, user=None, task_uuid=None, timeout=120): 396 def save_as_async(self, disk, task_uuid=None, timeout=300, user=None): 397 return local_tasks.save_as.apply_async(args=[disk, timeout, user], 398 queue="localhost.man") 399 400 def save_as(self, user=None, task_uuid=None, timeout=300): -
Owner
Is this timeout of 5 minutes normally enough?
-
-
1001 # save template 1002 tmpl.save() 1003 try: 1004 # create interface templates 1005 for i in self.interface_set.all(): 1006 i.save_as_template(tmpl) 1007 except: 1008 tmpl.delete() 1009 raise 1010 else: 1011 return tmpl 975 def save_as_template(self, name, task_uuid=None, user=None, 976 timeout=300, **kwargs): 977 with instance_activity(code_suffix="save_as_template", instance=self, 978 task_uuid=task_uuid, user=user): 979 # prepare parameters -
Owner
defaults = {...}, defaults.update(kwargs)
?
-
-
Owner
ping
-
Owner
Oh, I'm assigned :o
-
-
-
-