mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-21 08:06:30 +00:00
Fix small bugs (python37) (#577)
* Fix small bugs (python37) * Update utils.py * Update utils.py * Update utils.py * Update utils.py * Update utils.py
This commit is contained in:
parent
3aa4cdf540
commit
1b481e0b37
@ -39,15 +39,15 @@ def check_installed(method):
|
|||||||
async def remove_data(folder):
|
async def remove_data(folder):
|
||||||
"""Remove folder and reset privileged."""
|
"""Remove folder and reset privileged."""
|
||||||
try:
|
try:
|
||||||
proc = await asyncio.create_subprocess_shell(
|
proc = await asyncio.create_subprocess_exec(
|
||||||
["rm", "-rf", str(folder)], stdout=asyncio.DEVNULL
|
"rm", "-rf", str(folder),
|
||||||
|
stdout=asyncio.subprocess.DEVNULL
|
||||||
)
|
)
|
||||||
|
|
||||||
response = await proc.communicate()
|
_, error_msg = await proc.communicate()
|
||||||
wrong = response[1].decode()
|
|
||||||
except OSError as err:
|
except OSError as err:
|
||||||
wrong = str(err)
|
error_msg = str(err)
|
||||||
|
|
||||||
if proc.returncode == 0:
|
if proc.returncode == 0:
|
||||||
return
|
return
|
||||||
_LOGGER.error("Can't remove Add-on Data: %s", wrong)
|
_LOGGER.error("Can't remove Add-on Data: %s", error_msg)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user