mirror of
https://github.com/docker/compose.git
synced 2025-07-25 22:54:54 +02:00
add restarting status for human_readable_state
Signed-off-by: Jean Praloran <jeanpralo@gmail.com>
This commit is contained in:
parent
a1217dc050
commit
c8f266b637
@ -115,6 +115,8 @@ class Container(object):
|
|||||||
def human_readable_state(self):
|
def human_readable_state(self):
|
||||||
if self.is_paused:
|
if self.is_paused:
|
||||||
return 'Paused'
|
return 'Paused'
|
||||||
|
if self.is_restarting:
|
||||||
|
return 'Restarting'
|
||||||
if self.is_running:
|
if self.is_running:
|
||||||
return 'Ghost' if self.get('State.Ghost') else 'Up'
|
return 'Ghost' if self.get('State.Ghost') else 'Up'
|
||||||
else:
|
else:
|
||||||
@ -134,6 +136,10 @@ class Container(object):
|
|||||||
def is_running(self):
|
def is_running(self):
|
||||||
return self.get('State.Running')
|
return self.get('State.Running')
|
||||||
|
|
||||||
|
@property
|
||||||
|
def is_restarting(self):
|
||||||
|
return self.get('State.Restarting')
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def is_paused(self):
|
def is_paused(self):
|
||||||
return self.get('State.Paused')
|
return self.get('State.Paused')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user