From a92b938b9c39409d823cc4d8f263d0e2ada1504d Mon Sep 17 00:00:00 2001 From: Seb Ruiz Date: Sun, 19 Jan 2020 20:55:27 +1100 Subject: [PATCH] Don't try to create conf_dir if it already exists --- custom_components/bhyve/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/custom_components/bhyve/__init__.py b/custom_components/bhyve/__init__.py index 65d4fd5..c289543 100644 --- a/custom_components/bhyve/__init__.py +++ b/custom_components/bhyve/__init__.py @@ -72,7 +72,8 @@ async def async_setup(hass, config): # Create storage/scratch directory. try: - os.mkdir(conf_dir) + if not os.path.exists(conf_dir): + os.mkdir(conf_dir) except Exception as err: _LOGGER.info("Could not create storage dir: %s", err) pass