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
2a1ce8f5
authored
Mar 20, 2014
by
Guba Sándor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
node: added legacy property for scheduler
parent
3b66d6d6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
3 deletions
+15
-3
circle/vm/models/node.py
+15
-3
No files found.
circle/vm/models/node.py
View file @
2a1ce8f5
...
@@ -7,6 +7,8 @@ from django.db.models import (
...
@@ -7,6 +7,8 @@ from django.db.models import (
)
)
from
django.utils.translation
import
ugettext_lazy
as
_
from
django.utils.translation
import
ugettext_lazy
as
_
from
warnings
import
warn
from
celery.exceptions
import
TimeoutError
from
celery.exceptions
import
TimeoutError
from
model_utils.models
import
TimeStampedModel
from
model_utils.models
import
TimeStampedModel
from
taggit.managers
import
TaggableManager
from
taggit.managers
import
TaggableManager
...
@@ -87,12 +89,22 @@ class Node(TimeStampedModel):
...
@@ -87,12 +89,22 @@ class Node(TimeStampedModel):
@method_cache
(
300
)
@method_cache
(
300
)
def
get_info
(
self
):
def
get_info
(
self
):
return
self
.
remote_query
(
vm_tasks
.
get_info
,
return
self
.
remote_query
(
vm_tasks
.
get_info
,
default
=
{
'c
pu
'
:
''
,
default
=
{
'c
ore_num
'
:
''
,
'ram'
:
'0'
,
'ram
_size
'
:
'0'
,
'arch'
:
''
})
'arch
itecture
'
:
''
})
info
=
property
(
get_info
)
info
=
property
(
get_info
)
@property
def
ram_size
(
self
):
warn
(
'Use Node.info["ram_size"]'
,
DeprecationWarning
)
return
self
.
info
[
'ram_size'
]
@property
def
num_cores
(
self
):
warn
(
'Use Node.info["core_num"]'
,
DeprecationWarning
)
return
self
.
info
[
'core_num'
]
STATES
=
{
False
:
{
False
:
(
'OFFLINE'
,
_
(
'offline'
)),
STATES
=
{
False
:
{
False
:
(
'OFFLINE'
,
_
(
'offline'
)),
True
:
(
'DISABLED'
,
_
(
'disabled'
))},
True
:
(
'DISABLED'
,
_
(
'disabled'
))},
True
:
{
False
:
(
'MISSING'
,
_
(
'missing'
)),
True
:
{
False
:
(
'MISSING'
,
_
(
'missing'
)),
...
...
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