From 295f27d259cebf065ce5b7867a2ef4e094f3e8df Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Sun, 15 Nov 2015 02:16:52 -0800 Subject: [PATCH] Only delete lib dir in config upgrade if exists --- homeassistant/bootstrap.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/homeassistant/bootstrap.py b/homeassistant/bootstrap.py index c66e6563cc1..4d68227d4d0 100644 --- a/homeassistant/bootstrap.py +++ b/homeassistant/bootstrap.py @@ -300,7 +300,9 @@ def process_ha_config_upgrade(hass): _LOGGER.info('Upgrading config directory from %s to %s', conf_version, __version__) - shutil.rmtree(hass.config.path('lib')) + lib_path = hass.config.path('lib') + if os.path.isdir(lib_path): + shutil.rmtree(lib_path) with open(version_path, 'wt') as outp: outp.write(__version__)