mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-19 15:16:33 +00:00
fix lock bug
This commit is contained in:
parent
c74228adca
commit
d4369acf8d
@ -31,11 +31,11 @@ class DockerBase(object):
|
|||||||
@property
|
@property
|
||||||
def in_progress(self):
|
def in_progress(self):
|
||||||
"""Return True if a task is in progress."""
|
"""Return True if a task is in progress."""
|
||||||
return self._lock.locked
|
return self._lock.locked()
|
||||||
|
|
||||||
async def install(self, tag):
|
async def install(self, tag):
|
||||||
"""Pull docker image."""
|
"""Pull docker image."""
|
||||||
if self._lock.locked:
|
if self._lock.locked():
|
||||||
_LOGGER.error("Can't excute install while a task is in progress")
|
_LOGGER.error("Can't excute install while a task is in progress")
|
||||||
return False
|
return False
|
||||||
|
|
||||||
@ -105,7 +105,7 @@ class DockerBase(object):
|
|||||||
|
|
||||||
async def attach(self):
|
async def attach(self):
|
||||||
"""Attach to running docker container."""
|
"""Attach to running docker container."""
|
||||||
if self._lock.locked:
|
if self._lock.locked():
|
||||||
_LOGGER.error("Can't excute attach while a task is in progress")
|
_LOGGER.error("Can't excute attach while a task is in progress")
|
||||||
return False
|
return False
|
||||||
|
|
||||||
@ -133,7 +133,7 @@ class DockerBase(object):
|
|||||||
|
|
||||||
async def run(self):
|
async def run(self):
|
||||||
"""Run docker image."""
|
"""Run docker image."""
|
||||||
if self._lock.locked:
|
if self._lock.locked():
|
||||||
_LOGGER.error("Can't excute run while a task is in progress")
|
_LOGGER.error("Can't excute run while a task is in progress")
|
||||||
return False
|
return False
|
||||||
|
|
||||||
@ -151,7 +151,7 @@ class DockerBase(object):
|
|||||||
|
|
||||||
async def stop(self):
|
async def stop(self):
|
||||||
"""Stop/remove docker container."""
|
"""Stop/remove docker container."""
|
||||||
if self._lock.locked:
|
if self._lock.locked():
|
||||||
_LOGGER.error("Can't excute stop while a task is in progress")
|
_LOGGER.error("Can't excute stop while a task is in progress")
|
||||||
return False
|
return False
|
||||||
|
|
||||||
@ -182,7 +182,7 @@ class DockerBase(object):
|
|||||||
|
|
||||||
Return a Future.
|
Return a Future.
|
||||||
"""
|
"""
|
||||||
if self._lock.locked:
|
if self._lock.locked():
|
||||||
_LOGGER.error("Can't excute update while a task is in progress")
|
_LOGGER.error("Can't excute update while a task is in progress")
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user