Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gelencsér Szabolcs
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
6b1e9548
authored
Oct 14, 2013
by
Őry Máté
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vm: use circle.acl instead of guardian
parent
666e2ede
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
circle/vm/models.py
+7
-7
No files found.
circle/vm/models.py
View file @
6b1e9548
...
...
@@ -15,7 +15,7 @@ from netaddr import EUI, mac_unix
from
.tasks
import
local_tasks
,
vm_tasks
,
net_tasks
from
firewall.models
import
Vlan
,
Host
from
storage.models
import
Disk
from
acl.models
import
AclBase
logger
=
logging
.
getLogger
(
__name__
)
pwgen
=
User
.
objects
.
make_random_password
...
...
@@ -256,7 +256,7 @@ class InterfaceTemplate(Model):
verbose_name_plural
=
_
(
'interface templates'
)
class
Instance
(
BaseResourceConfigModel
,
TimeStampedModel
):
class
Instance
(
AclBase
,
BaseResourceConfigModel
,
TimeStampedModel
):
"""Virtual machine instance.
...
...
@@ -282,6 +282,11 @@ class Instance(BaseResourceConfigModel, TimeStampedModel):
(
'SHUTOFF'
,
_
(
'shutoff'
)),
(
'CRASHED'
,
_
(
'crashed'
)),
(
'PMSUSPENDED'
,
_
(
'pmsuspended'
))]
# libvirt domain states
ACL_LEVELS
=
(
(
'user'
,
_
(
'user'
)),
# see all details
(
'operator'
,
_
(
'operator'
)),
# console, networking, change state
(
'owner'
,
_
(
'owner'
)),
# superuser, can delete, delegate perms
)
name
=
CharField
(
blank
=
True
,
max_length
=
100
,
verbose_name
=
_
(
'name'
),
help_text
=
_
(
'Human readable name of instance.'
))
description
=
TextField
(
blank
=
True
,
verbose_name
=
_
(
'description'
))
...
...
@@ -321,11 +326,6 @@ class Instance(BaseResourceConfigModel, TimeStampedModel):
class
Meta
:
ordering
=
[
'pk'
,
]
permissions
=
(
(
'own_instance'
,
_
(
'owner'
)),
# superuser, can delete, delegate perms
(
'operate_instance'
,
_
(
'operator'
)),
# console, networking, change state
(
'use_instance'
,
_
(
'user'
)),
# see all details
)
verbose_name
=
_
(
'instance'
)
verbose_name_plural
=
_
(
'instances'
)
...
...
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