Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gutyán Gábor
/
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
5652a625
authored
Mar 18, 2014
by
Guba Sándor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
storage: fixed ready and added failed property
parent
f165822b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletions
+11
-1
circle/storage/models.py
+11
-1
No files found.
circle/storage/models.py
View file @
5652a625
...
@@ -123,8 +123,18 @@ class Disk(AclBase, TimeStampedModel):
...
@@ -123,8 +123,18 @@ class Disk(AclBase, TimeStampedModel):
@property
@property
def
ready
(
self
):
def
ready
(
self
):
""" Returns True if the disk is physically ready on the storage.
It needs at least 1 successfull deploy action.
"""
return
self
.
activity_log
.
filter
(
activity_code__endswith
=
"deploy"
,
return
self
.
activity_log
.
filter
(
activity_code__endswith
=
"deploy"
,
succeeded__isnull
=
False
)
succeeded
=
True
)
@property
def
failed
(
self
):
""" Returns True if the last activity on the disk is failed.
"""
return
not
self
.
activity_log
.
all
()
.
order_by
(
'-id'
)[
0
]
.
succeeded
@property
@property
def
path
(
self
):
def
path
(
self
):
...
...
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