Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gyuricska Milán
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
499c91ff
authored
Feb 19, 2014
by
Dudás Ádám
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vm: move 'system' field to common base class
parent
47b46b44
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
circle/vm/migrations/0017_auto__add_field_instance_system__add_field_instancetemplate_owner.py
+0
-0
circle/vm/models/instance.py
+6
-6
No files found.
circle/vm/migrations/0017_auto__add_field_instance_system__add_field_instancetemplate_owner.py
0 → 100644
View file @
499c91ff
This diff is collapsed.
Click to expand it.
circle/vm/models/instance.py
View file @
499c91ff
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment