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
692f0819
authored
Apr 29, 2014
by
Dudás Ádám
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vm: revised implementation of InstanceActivity.is_abortable
parent
c13f128d
Show 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):
...
@@ -67,6 +67,15 @@ class InstanceActivity(ActivityModel):
else
:
else
:
return
'failed'
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
@classmethod
def
create
(
cls
,
code_suffix
,
instance
,
task_uuid
=
None
,
user
=
None
,
def
create
(
cls
,
code_suffix
,
instance
,
task_uuid
=
None
,
user
=
None
,
concurrency_check
=
True
):
concurrency_check
=
True
):
...
@@ -108,10 +117,6 @@ class InstanceActivity(ActivityModel):
...
@@ -108,10 +117,6 @@ class InstanceActivity(ActivityModel):
self
.
instance
.
_update_status
()
self
.
instance
.
_update_status
()
return
ret
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
):
def
abort
(
self
):
AbortableAsyncResult
(
self
.
task_uuid
,
backend
=
celery
.
backend
)
.
abort
()
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