Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Fukász Rómeó Ervin
/
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
682973b3
authored
Jul 29, 2014
by
Őry Máté
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: handle HumanReadableException in OperationView
parent
588190f6
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
circle/dashboard/views.py
+10
-2
No files found.
circle/dashboard/views.py
View file @
682973b3
...
@@ -71,7 +71,7 @@ from .tables import (
...
@@ -71,7 +71,7 @@ from .tables import (
NodeListTable
,
NodeVmListTable
,
TemplateListTable
,
LeaseListTable
,
NodeListTable
,
NodeVmListTable
,
TemplateListTable
,
LeaseListTable
,
GroupListTable
,
UserKeyListTable
GroupListTable
,
UserKeyListTable
)
)
from
common.models
import
HumanReadableObject
from
common.models
import
HumanReadableObject
,
HumanReadableException
from
vm.models
import
(
from
vm.models
import
(
Instance
,
instance_activity
,
InstanceActivity
,
InstanceTemplate
,
Interface
,
Instance
,
instance_activity
,
InstanceActivity
,
InstanceTemplate
,
Interface
,
InterfaceTemplate
,
Lease
,
Node
,
NodeActivity
,
Trait
,
InterfaceTemplate
,
Lease
,
Node
,
NodeActivity
,
Trait
,
...
@@ -562,9 +562,13 @@ class OperationView(RedirectToLoginMixin, DetailView):
...
@@ -562,9 +562,13 @@ class OperationView(RedirectToLoginMixin, DetailView):
done
=
False
done
=
False
try
:
try
:
task
=
self
.
get_op
()
.
async
(
user
=
request
.
user
,
**
extra
)
task
=
self
.
get_op
()
.
async
(
user
=
request
.
user
,
**
extra
)
except
HumanReadableException
as
e
:
e
.
send_message
(
request
)
logger
.
exception
(
"Could not start operation"
)
result
=
e
except
Exception
as
e
:
except
Exception
as
e
:
messages
.
error
(
request
,
_
(
'Could not start operation.'
))
messages
.
error
(
request
,
_
(
'Could not start operation.'
))
logger
.
exception
(
e
)
logger
.
exception
(
"Could not start operation"
)
result
=
e
result
=
e
else
:
else
:
wait
=
self
.
wait_for_result
wait
=
self
.
wait_for_result
...
@@ -575,6 +579,10 @@ class OperationView(RedirectToLoginMixin, DetailView):
...
@@ -575,6 +579,10 @@ class OperationView(RedirectToLoginMixin, DetailView):
except
TimeoutError
:
except
TimeoutError
:
logger
.
debug
(
"Result didn't arrive in
%
ss"
,
logger
.
debug
(
"Result didn't arrive in
%
ss"
,
self
.
wait_for_result
,
exc_info
=
True
)
self
.
wait_for_result
,
exc_info
=
True
)
except
HumanReadableException
as
e
:
e
.
send_message
(
request
)
logger
.
exception
(
e
)
result
=
e
except
Exception
as
e
:
except
Exception
as
e
:
messages
.
error
(
request
,
_
(
'Operation failed.'
))
messages
.
error
(
request
,
_
(
'Operation failed.'
))
logger
.
debug
(
"Operation failed."
,
exc_info
=
True
)
logger
.
debug
(
"Operation failed."
,
exc_info
=
True
)
...
...
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