Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gyuricska Milán
/
cloud
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
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
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
8 deletions
+9
-8
circle/storage/models.py
+9
-8
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
task
=
self
.
activity_log
.
filter
(
try
:
activity_code__endswith
=
"deploy"
,
task
=
self
.
activity_log
.
filter
(
succeeded__isnull
=
True
)[
0
]
.
task_uuid
activity_code__endswith
=
"deploy"
,
result
=
celery
.
AsyncResult
(
id
=
task
)
succeeded__isnull
=
True
)[
0
]
.
task_uuid
return
result
.
info
.
get
(
"percent"
)
result
=
celery
.
AsyncResult
(
id
=
task
)
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