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
50c045e9
authored
Jun 06, 2014
by
Guba Sándor
Committed by
Őry Máté
Jun 13, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vm: added has_ercentage and get_percentage to activities
parent
879ccc6c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
circle/vm/models/activity.py
+11
-0
No files found.
circle/vm/models/activity.py
View file @
50c045e9
...
@@ -116,6 +116,17 @@ class InstanceActivity(ActivityModel):
...
@@ -116,6 +116,17 @@ class InstanceActivity(ActivityModel):
else
:
else
:
return
'failed'
return
'failed'
def
has_percentage
(
self
):
op
=
self
.
instance
.
get_operation_from_activity_code
(
self
.
activity_code
)
return
(
self
.
task_uuid
and
op
and
op
.
has_percentage
and
not
self
.
finished
)
def
get_percentage
(
self
):
"""Returns the percentage of the running operation if available.
"""
if
self
.
has_percentage
():
celery
.
AsyncResult
(
id
=
self
.
task_uuid
)
.
info
.
get
(
"percent"
)
@property
@property
def
is_abortable
(
self
):
def
is_abortable
(
self
):
"""Can the activity be aborted?
"""Can the activity be aborted?
...
...
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