Commit 499c91ff by Dudás Ádám

vm: move 'system' field to common base class

parent 47b46b44
...@@ -74,6 +74,11 @@ class VirtualMachineDescModel(BaseResourceConfigModel): ...@@ -74,6 +74,11 @@ class VirtualMachineDescModel(BaseResourceConfigModel):
"node to declare to be suitable " "node to declare to be suitable "
"for hosting the VM."), "for hosting the VM."),
verbose_name=_("required traits")) verbose_name=_("required traits"))
system = TextField(verbose_name=_('operating system'),
blank=True,
help_text=(_('Name of operating system in '
'format like "%s".') %
'Ubuntu 12.04 LTS Desktop amd64'))
tags = TaggableManager(blank=True, verbose_name=_("tags")) tags = TaggableManager(blank=True, verbose_name=_("tags"))
class Meta: class Meta:
...@@ -111,11 +116,6 @@ class InstanceTemplate(AclBase, VirtualMachineDescModel, TimeStampedModel): ...@@ -111,11 +116,6 @@ class InstanceTemplate(AclBase, VirtualMachineDescModel, TimeStampedModel):
parent = ForeignKey('self', null=True, blank=True, parent = ForeignKey('self', null=True, blank=True,
verbose_name=_('parent template'), verbose_name=_('parent template'),
help_text=_('Template which this one is derived of.')) help_text=_('Template which this one is derived of.'))
system = TextField(verbose_name=_('operating system'),
blank=True,
help_text=(_('Name of operating system in '
'format like "%s".') %
'Ubuntu 12.04 LTS Desktop amd64'))
state = CharField(max_length=10, choices=STATES, default='NEW') state = CharField(max_length=10, choices=STATES, default='NEW')
disks = ManyToManyField(Disk, verbose_name=_('disks'), disks = ManyToManyField(Disk, verbose_name=_('disks'),
related_name='template_set', related_name='template_set',
...@@ -963,7 +963,7 @@ class Instance(AclBase, VirtualMachineDescModel, TimeStampedModel): ...@@ -963,7 +963,7 @@ class Instance(AclBase, VirtualMachineDescModel, TimeStampedModel):
def __try_save_disk(disk): def __try_save_disk(disk):
try: try:
return disk.save_as() return disk.save_as() # can do in parallel
except Disk.WrongDiskTypeError: except Disk.WrongDiskTypeError:
return disk return disk
......
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