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
Commit
7cd242ed
authored
Sep 08, 2014
by
Őry Máté
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
manager: make scheduler errors human readable
fixes
#272
parent
eb5c95c3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
10 deletions
+21
-10
circle/manager/scheduler.py
+21
-10
No files found.
circle/manager/scheduler.py
View file @
7cd242ed
...
...
@@ -18,26 +18,37 @@
from
logging
import
getLogger
from
django.db.models
import
Sum
from
django.utils.translation
import
ugettext_noop
from
common.models
import
HumanReadableException
logger
=
getLogger
(
__name__
)
class
NotEnoughMemoryException
(
Exception
):
class
SchedulerError
(
HumanReadableException
):
admin_message
=
None
def
__init__
(
self
,
message
=
None
):
if
message
is
None
:
message
=
"No node has enough memory to accomodate the guest."
def
__init__
(
self
,
params
=
None
,
level
=
None
,
**
kwargs
):
kwargs
.
update
(
params
or
{})
super
(
SchedulerError
,
self
)
.
__init__
(
level
,
self
.
message
,
self
.
admin_message
or
self
.
message
,
kwargs
)
Exception
.
__init__
(
self
,
message
)
class
NotEnoughMemoryException
(
SchedulerError
):
message
=
ugettext_noop
(
"The resources required for launching the virtual machine are not "
"available currently. Please try again later."
)
class
TraitsUnsatisfiableException
(
Exception
):
admin_message
=
ugettext_noop
(
"The required free memory for launching the virtual machine is not "
"available on any usable node currently. Please try again later."
)
def
__init__
(
self
,
message
=
None
):
if
message
is
None
:
message
=
"No node can satisfy all required traits of the guest."
Exception
.
__init__
(
self
,
message
)
class
TraitsUnsatisfiableException
(
SchedulerError
):
message
=
ugettext_noop
(
"No node can satisfy the required traits of the "
"new vitual machine currently."
)
def
select_node
(
instance
,
nodes
):
...
...
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