Skip to content

Commit

Permalink
Remove logging of retrying config entry warning (#101483)
Browse files Browse the repository at this point in the history
  • Loading branch information
frenck committed Oct 5, 2023
1 parent fe316f2 commit 6853d54
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 26 deletions.
31 changes: 10 additions & 21 deletions homeassistant/config_entries.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,27 +437,16 @@ async def async_setup(
self._tries += 1
message = str(ex)
ready_message = f"ready yet: {message}" if message else "ready yet"
if self._tries == 1:
_LOGGER.warning(
(
"Config entry '%s' for %s integration not %s; Retrying in"
" background"
),
self.title,
self.domain,
ready_message,
)
else:
_LOGGER.debug(
(
"Config entry '%s' for %s integration not %s; Retrying in %d"
" seconds"
),
self.title,
self.domain,
ready_message,
wait_time,
)
_LOGGER.debug(
(
"Config entry '%s' for %s integration not %s; Retrying in %d"
" seconds"
),
self.title,
self.domain,
ready_message,
wait_time,
)

if hass.state == CoreState.running:
self._async_cancel_retry_setup = async_call_later(
Expand Down
8 changes: 4 additions & 4 deletions tests/components/nest/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,19 +107,19 @@ async def test_setup_configuration_failure(

@pytest.mark.parametrize("subscriber_side_effect", [SubscriberException()])
async def test_setup_susbcriber_failure(
hass: HomeAssistant, warning_caplog, failing_subscriber, setup_base_platform
hass: HomeAssistant, caplog, failing_subscriber, setup_base_platform
) -> None:
"""Test configuration error."""
await setup_base_platform()
assert "Subscriber error:" in warning_caplog.text
assert "Subscriber error:" in caplog.text

entries = hass.config_entries.async_entries(DOMAIN)
assert len(entries) == 1
assert entries[0].state is ConfigEntryState.SETUP_RETRY


async def test_setup_device_manager_failure(
hass: HomeAssistant, warning_caplog, setup_base_platform
hass: HomeAssistant, caplog, setup_base_platform
) -> None:
"""Test device manager api failure."""
with patch(
Expand All @@ -130,7 +130,7 @@ async def test_setup_device_manager_failure(
):
await setup_base_platform()

assert "Device manager error:" in warning_caplog.text
assert "Device manager error:" in caplog.text

entries = hass.config_entries.async_entries(DOMAIN)
assert len(entries) == 1
Expand Down
2 changes: 1 addition & 1 deletion tests/components/yeelight/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -641,5 +641,5 @@ async def test_async_setup_retries_with_wrong_device(
assert config_entry.state is ConfigEntryState.SETUP_RETRY
assert (
"Unexpected device found at 192.168.1.239; expected 0x0000000000999999, "
"found 0x000000000015243f; Retrying in background"
"found 0x000000000015243f; Retrying in"
) in caplog.text

0 comments on commit 6853d54

Please sign in to comment.