1
0
mirror of https://github.com/home-assistant/supervisor.git synced 2026-02-15 07:27:13 +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:
Pascal Vizeli
2018-07-19 21:22:26 +02:00
committed by GitHub
parent 3aa4cdf540
commit 1b481e0b37

View File

@@ -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)