Commit 0c033922 by Kálmán Viktor

vm: temp fix in Instance model

parent d06a2799
...@@ -362,12 +362,13 @@ class Instance(VirtualMachineDescModel, TimeStampedModel): ...@@ -362,12 +362,13 @@ class Instance(VirtualMachineDescModel, TimeStampedModel):
kwargs.setdefault('raw_data', template.raw_data) kwargs.setdefault('raw_data', template.raw_data)
kwargs.setdefault('lease', kwargs.setdefault('lease',
kwargs.setdefault('access_method', template.access_method) kwargs.setdefault('access_method', template.access_method)
disks = kwargs.get('disks', template.disks.all())
# create instance and do additional setup # create instance and do additional setup
inst = cls(**kwargs) inst = cls(**kwargs)
# save instance # save instance
# create related entities # create related entities
disks = kwargs.get('disks', template.disks.all())
for disk in disks: for disk in disks:
inst.disks.add(disk.get_exclusive()) inst.disks.add(disk.get_exclusive())
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