mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-19 15:16:33 +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):
|
||||
"""Remove folder and reset privileged."""
|
||||
try:
|
||||
proc = await asyncio.create_subprocess_shell(
|
||||
["rm", "-rf", str(folder)], stdout=asyncio.DEVNULL
|
||||
proc = await asyncio.create_subprocess_exec(
|
||||
"rm", "-rf", str(folder),
|
||||
stdout=asyncio.subprocess.DEVNULL
|
||||
)
|
||||
|
||||
response = await proc.communicate()
|
||||
wrong = response[1].decode()
|
||||
_, error_msg = await proc.communicate()
|
||||
except OSError as err:
|
||||
wrong = str(err)
|
||||
error_msg = str(err)
|
||||
|
||||
if proc.returncode == 0:
|
||||
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