Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gelencsér Szabolcs
/
circlestack
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
692f0819
authored
Apr 29, 2014
by
Dudás Ádám
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vm: revised implementation of InstanceActivity.is_abortable
parent
c13f128d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
+9
-4
circle/vm/models/activity.py
+9
-4
No files found.
circle/vm/models/activity.py
View file @
692f0819
...
...
@@ -67,6 +67,15 @@ class InstanceActivity(ActivityModel):
else
:
return
'failed'
@property
def
is_abortable
(
self
):
"""Can the activity be aborted?
:returns: True if the activity can be aborted; otherwise, False.
"""
op
=
self
.
instance
.
get_operation_from_activity_code
(
self
.
activity_code
)
return
self
.
task_uuid
and
op
and
op
.
abortable
and
not
self
.
finished
@classmethod
def
create
(
cls
,
code_suffix
,
instance
,
task_uuid
=
None
,
user
=
None
,
concurrency_check
=
True
):
...
...
@@ -108,10 +117,6 @@ class InstanceActivity(ActivityModel):
self
.
instance
.
_update_status
()
return
ret
def
is_abortable
(
self
):
op
=
self
.
instance
.
get_operation_from_activity_code
(
self
.
activity_code
)
return
False
if
op
is
None
else
(
op
.
abortable
and
not
self
.
finished
)
def
abort
(
self
):
AbortableAsyncResult
(
self
.
task_uuid
,
backend
=
celery
.
backend
)
.
abort
()
...
...
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