Handle ConnectionError if proxmoxve host is not reachable (#51970)

* handle ConnectionError if host is not reachable

* import only needed exceptions

fix pylint issue

* don't overwrite built-in ConnectionError

* fix typo
This commit is contained in:
maurerle 2021-06-22 20:54:27 +02:00 committed by GitHub
parent 04b425ed89
commit ba3416b724
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -124,6 +124,9 @@ async def async_setup(hass: HomeAssistant, config: dict):
except ConnectTimeout:
_LOGGER.warning("Connection to host %s timed out during setup", host)
continue
except requests.exceptions.ConnectionError:
_LOGGER.warning("Host %s is not reachable", host)
continue
hass.data[PROXMOX_CLIENTS][host] = proxmox_client