Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
94
Merge Requests
10
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
A prog2-höz tartozó friss repo anyagok itt elérhetőek:
https://git.iit.bme.hu/
Commit
2564bc5d
authored
Nov 15, 2013
by
Dudás Ádám
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vm: fix tags
parent
046c28f9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
circle/vm/models.py
+9
-5
No files found.
circle/vm/models.py
View file @
2564bc5d
...
...
@@ -17,10 +17,10 @@ from model_utils.models import TimeStampedModel
from
taggit.managers
import
TaggableManager
from
.tasks
import
local_tasks
,
vm_tasks
,
net_tasks
from
acl.models
import
AclBase
from
common.models
import
ActivityModel
,
activitycontextimpl
from
firewall.models
import
Vlan
,
Host
from
storage.models
import
Disk
from
common.models
import
ActivityModel
,
activitycontextimpl
from
acl.models
import
AclBase
logger
=
logging
.
getLogger
(
__name__
)
pwgen
=
User
.
objects
.
make_random_password
...
...
@@ -77,7 +77,7 @@ class VirtualMachineDescModel(BaseResourceConfigModel):
'Show boot device selection menu on boot.'
))
raw_data
=
TextField
(
verbose_name
=
_
(
'raw_data'
),
blank
=
True
,
help_text
=
_
(
'Additional libvirt domain parameters in XML format.'
))
tags
=
TaggableManager
()
tags
=
TaggableManager
(
blank
=
True
,
verbose_name
=
_
(
"tags"
)
)
class
Meta
:
abstract
=
True
...
...
@@ -102,7 +102,7 @@ class Node(TimeStampedModel):
enabled
=
BooleanField
(
verbose_name
=
_
(
'enabled'
),
default
=
False
,
help_text
=
_
(
'Indicates whether the node can '
'be used for hosting.'
))
tags
=
TaggableManager
()
tags
=
TaggableManager
(
blank
=
True
,
verbose_name
=
_
(
"tags"
)
)
class
Meta
:
permissions
=
()
...
...
@@ -350,7 +350,7 @@ class Instance(AclBase, VirtualMachineDescModel, TimeStampedModel):
@classmethod
def
create_from_template
(
cls
,
template
,
owner
,
disks
=
None
,
networks
=
None
,
**
kwargs
):
tags
=
None
,
**
kwargs
):
"""Create a new instance based on an InstanceTemplate.
Can also specify parameters as keyword arguments which should override
...
...
@@ -361,6 +361,8 @@ class Instance(AclBase, VirtualMachineDescModel, TimeStampedModel):
networks
=
(
template
.
interface_set
.
all
()
if
networks
is
None
else
networks
)
tags
=
template
.
tags
.
all
()
if
tags
is
None
else
tags
# prepare parameters
kwargs
[
'template'
]
=
template
kwargs
[
'owner'
]
=
owner
...
...
@@ -389,6 +391,8 @@ class Instance(AclBase, VirtualMachineDescModel, TimeStampedModel):
# TODO fix this port fw
i
.
host
.
add_port
(
proto
,
private
=
port
)
inst
.
tags
.
add
(
*
tags
)
return
inst
@permalink
...
...
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