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
6693f199
authored
Mar 19, 2014
by
Kálmán Viktor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
storage: fix disk download methods
parent
b8034782
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
circle/storage/models.py
+4
-3
No files found.
circle/storage/models.py
View file @
6693f199
...
@@ -181,18 +181,19 @@ class Disk(AclBase, TimeStampedModel):
...
@@ -181,18 +181,19 @@ class Disk(AclBase, TimeStampedModel):
}[
self
.
type
]
}[
self
.
type
]
def
is_downloading
(
self
):
def
is_downloading
(
self
):
return
self
.
activity_log
.
filter
(
return
self
.
size
is
None
and
not
self
.
failed
activity_code__endswith
=
"downloading_disk"
,
succeeded__isnull
=
True
)
def
get_download_percentage
(
self
):
def
get_download_percentage
(
self
):
if
not
self
.
is_downloading
():
if
not
self
.
is_downloading
():
return
None
return
None
try
:
task
=
self
.
activity_log
.
filter
(
task
=
self
.
activity_log
.
filter
(
activity_code__endswith
=
"deploy"
,
activity_code__endswith
=
"deploy"
,
succeeded__isnull
=
True
)[
0
]
.
task_uuid
succeeded__isnull
=
True
)[
0
]
.
task_uuid
result
=
celery
.
AsyncResult
(
id
=
task
)
result
=
celery
.
AsyncResult
(
id
=
task
)
return
result
.
info
.
get
(
"percent"
)
return
result
.
info
.
get
(
"percent"
)
except
:
return
0
def
get_latest_activity_result
(
self
):
def
get_latest_activity_result
(
self
):
return
self
.
activity_log
.
latest
(
"pk"
)
.
result
return
self
.
activity_log
.
latest
(
"pk"
)
.
result
...
...
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