Only delete lib dir in config upgrade if exists
This commit is contained in:
1 parent
71e4283a2e
commit
295f27d259
1 file changed
+3
-1
@@ -300,7 +300,9 @@ def process_ha_config_upgrade(hass):
|
|||||||
_LOGGER.info('Upgrading config directory from %s to %s', conf_version,
|
_LOGGER.info('Upgrading config directory from %s to %s', conf_version,
|
||||||
__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:
|
with open(version_path, 'wt') as outp:
|
||||||
outp.write(__version__)
|
outp.write(__version__)
|
||||||
|
|||||||
Reference in new issue
Block a user