mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-09 18:26:30 +00:00
parent
034393bd42
commit
fe0e41adec
@ -5,7 +5,7 @@
|
||||
declare failed_count=0
|
||||
declare supervisor_state
|
||||
|
||||
bashio::log.info "Start local supervisor watchdog..."
|
||||
bashio::log.info "Starting local supervisor watchdog..."
|
||||
|
||||
while [[ failed_count -lt 2 ]];
|
||||
do
|
||||
@ -31,4 +31,4 @@ do
|
||||
|
||||
done
|
||||
|
||||
basio::exit.nok "Watchdog detect issue with Supervisor - take container down!"
|
||||
basio::exit.nok "Watchdog detected issue with Supervisor - taking container down!"
|
||||
|
@ -36,24 +36,24 @@ if __name__ == "__main__":
|
||||
executor = ThreadPoolExecutor(thread_name_prefix="SyncWorker")
|
||||
loop.set_default_executor(executor)
|
||||
|
||||
_LOGGER.info("Initialize Supervisor setup")
|
||||
_LOGGER.info("Initializing Supervisor setup")
|
||||
coresys = loop.run_until_complete(bootstrap.initialize_coresys())
|
||||
loop.run_until_complete(coresys.core.connect())
|
||||
|
||||
bootstrap.supervisor_debugger(coresys)
|
||||
bootstrap.migrate_system_env(coresys)
|
||||
|
||||
_LOGGER.info("Setup Supervisor")
|
||||
_LOGGER.info("Setting up Supervisor")
|
||||
loop.run_until_complete(coresys.core.setup())
|
||||
|
||||
loop.call_soon_threadsafe(loop.create_task, coresys.core.start())
|
||||
loop.call_soon_threadsafe(bootstrap.reg_signal, loop, coresys)
|
||||
|
||||
try:
|
||||
_LOGGER.info("Run Supervisor")
|
||||
_LOGGER.info("Running Supervisor")
|
||||
loop.run_forever()
|
||||
finally:
|
||||
loop.close()
|
||||
|
||||
_LOGGER.info("Close Supervisor")
|
||||
_LOGGER.info("Closing Supervisor")
|
||||
sys.exit(0)
|
||||
|
@ -93,7 +93,7 @@ class AddonManager(CoreSysAttributes):
|
||||
tasks.append(addon)
|
||||
|
||||
# Evaluate add-ons which need to be started
|
||||
_LOGGER.info("Phase '%s' start %d add-ons", stage, len(tasks))
|
||||
_LOGGER.info("Phase '%s' starting %d add-ons", stage, len(tasks))
|
||||
if not tasks:
|
||||
return
|
||||
|
||||
@ -127,7 +127,7 @@ class AddonManager(CoreSysAttributes):
|
||||
tasks.append(addon)
|
||||
|
||||
# Evaluate add-ons which need to be stopped
|
||||
_LOGGER.info("Phase '%s' stop %d add-ons", stage, len(tasks))
|
||||
_LOGGER.info("Phase '%s' stopping %d add-ons", stage, len(tasks))
|
||||
if not tasks:
|
||||
return
|
||||
|
||||
@ -159,7 +159,9 @@ class AddonManager(CoreSysAttributes):
|
||||
addon = Addon(self.coresys, slug)
|
||||
|
||||
if not addon.path_data.is_dir():
|
||||
_LOGGER.info("Create Home Assistant add-on data folder %s", addon.path_data)
|
||||
_LOGGER.info(
|
||||
"Creating Home Assistant add-on data folder %s", addon.path_data
|
||||
)
|
||||
addon.path_data.mkdir()
|
||||
|
||||
# Setup/Fix AppArmor profile
|
||||
@ -346,7 +348,7 @@ class AddonManager(CoreSysAttributes):
|
||||
return
|
||||
|
||||
for addon in needs_repair:
|
||||
_LOGGER.info("Start repair for add-on: %s", addon.slug)
|
||||
_LOGGER.info("Repairing for add-on: %s", addon.slug)
|
||||
await self.sys_run_in_executor(
|
||||
self.sys_docker.network.stale_cleanup, addon.instance.name
|
||||
)
|
||||
|
@ -463,7 +463,7 @@ class Addon(AddonModel):
|
||||
if not self.path_data.is_dir():
|
||||
return
|
||||
|
||||
_LOGGER.info("Remove add-on data folder %s", self.path_data)
|
||||
_LOGGER.info("Removing add-on data folder %s", self.path_data)
|
||||
await remove_data(self.path_data)
|
||||
|
||||
def write_pulse(self) -> None:
|
||||
@ -545,7 +545,7 @@ class Addon(AddonModel):
|
||||
async def start(self) -> None:
|
||||
"""Set options and start add-on."""
|
||||
if await self.instance.is_running():
|
||||
_LOGGER.warning("%s already running!", self.slug)
|
||||
_LOGGER.warning("%s is already running!", self.slug)
|
||||
return
|
||||
|
||||
# Access Token
|
||||
@ -676,7 +676,7 @@ class Addon(AddonModel):
|
||||
)
|
||||
|
||||
try:
|
||||
_LOGGER.info("Build snapshot for add-on %s", self.slug)
|
||||
_LOGGER.info("Building snapshot for add-on %s", self.slug)
|
||||
await self.sys_run_in_executor(_write_tarfile)
|
||||
except (tarfile.TarError, OSError) as err:
|
||||
_LOGGER.error("Can't write tarfile %s: %s", tar_file, err)
|
||||
@ -731,7 +731,7 @@ class Addon(AddonModel):
|
||||
# Check version / restore image
|
||||
version = data[ATTR_VERSION]
|
||||
if not await self.instance.exists():
|
||||
_LOGGER.info("Restore/Install image for addon %s", self.slug)
|
||||
_LOGGER.info("Restore/Install of image for addon %s", self.slug)
|
||||
|
||||
image_file = Path(temp, "image.tar")
|
||||
if image_file.is_file():
|
||||
@ -742,7 +742,7 @@ class Addon(AddonModel):
|
||||
await self.instance.install(version, restore_image)
|
||||
await self.instance.cleanup()
|
||||
elif self.instance.version != version or self.legacy:
|
||||
_LOGGER.info("Restore/Update image for addon %s", self.slug)
|
||||
_LOGGER.info("Restore/Update of image for addon %s", self.slug)
|
||||
with suppress(DockerError):
|
||||
await self.instance.update(version, restore_image)
|
||||
else:
|
||||
@ -754,7 +754,7 @@ class Addon(AddonModel):
|
||||
"""Restore data."""
|
||||
shutil.copytree(Path(temp, "data"), self.path_data, symlinks=True)
|
||||
|
||||
_LOGGER.info("Restore data for addon %s", self.slug)
|
||||
_LOGGER.info("Restoring data for addon %s", self.slug)
|
||||
if self.path_data.is_dir():
|
||||
await remove_data(self.path_data)
|
||||
try:
|
||||
@ -778,4 +778,4 @@ class Addon(AddonModel):
|
||||
if data[ATTR_STATE] == AddonState.STARTED:
|
||||
return await self.start()
|
||||
|
||||
_LOGGER.info("Finish restore for add-on %s", self.slug)
|
||||
_LOGGER.info("Finished restore for add-on %s", self.slug)
|
||||
|
@ -459,7 +459,7 @@ class RestAPI(CoreSysAttributes):
|
||||
except OSError as err:
|
||||
_LOGGER.critical("Failed to create HTTP server at 0.0.0.0:80 -> %s", err)
|
||||
else:
|
||||
_LOGGER.info("Start API on %s", self.sys_docker.network.supervisor)
|
||||
_LOGGER.info("Starting API on %s", self.sys_docker.network.supervisor)
|
||||
|
||||
async def stop(self) -> None:
|
||||
"""Stop RESTful API webserver."""
|
||||
@ -470,4 +470,4 @@ class RestAPI(CoreSysAttributes):
|
||||
await self._site.stop()
|
||||
await self._runner.cleanup()
|
||||
|
||||
_LOGGER.info("Stop API on %s", self.sys_docker.network.supervisor)
|
||||
_LOGGER.info("Stopping API on %s", self.sys_docker.network.supervisor)
|
||||
|
@ -339,7 +339,7 @@ class APIAddons(CoreSysAttributes):
|
||||
body: Dict[str, Any] = await api_validate(SCHEMA_SECURITY, request)
|
||||
|
||||
if ATTR_PROTECTED in body:
|
||||
_LOGGER.warning("Protected flag changing for %s!", addon.slug)
|
||||
_LOGGER.warning("Changing protected flag for %s!", addon.slug)
|
||||
addon.protected = body[ATTR_PROTECTED]
|
||||
|
||||
addon.save_persist()
|
||||
|
@ -124,7 +124,9 @@ class APIProxy(CoreSysAttributes):
|
||||
|
||||
if data.get("type") != "auth_required":
|
||||
# Invalid protocol
|
||||
_LOGGER.error("Got unexpected response from HA WebSocket: %s", data)
|
||||
_LOGGER.error(
|
||||
"Got unexpected response from Home Assistant WebSocket: %s", data
|
||||
)
|
||||
raise APIError()
|
||||
|
||||
# Auth session
|
||||
|
@ -139,7 +139,7 @@ class SecurityMiddleware(CoreSysAttributes):
|
||||
|
||||
# Blacklist
|
||||
if BLACKLIST.match(request.path):
|
||||
_LOGGER.warning("%s is blacklisted!", request.path)
|
||||
_LOGGER.error("%s is blacklisted!", request.path)
|
||||
raise HTTPForbidden()
|
||||
|
||||
# Ignore security check
|
||||
|
@ -175,7 +175,7 @@ class APISnapshots(CoreSysAttributes):
|
||||
"""Download a snapshot file."""
|
||||
snapshot = self._extract_snapshot(request)
|
||||
|
||||
_LOGGER.info("Download snapshot %s", snapshot.slug)
|
||||
_LOGGER.info("Downloading snapshot %s", snapshot.slug)
|
||||
response = web.FileResponse(snapshot.tarfile)
|
||||
response.content_type = CONTENT_TYPE_TAR
|
||||
response.headers[
|
||||
|
@ -51,14 +51,14 @@ class CpuArch(CoreSysAttributes):
|
||||
try:
|
||||
arch_data = read_json_file(ARCH_JSON)
|
||||
except JsonFileError:
|
||||
_LOGGER.warning("Can't read arch json")
|
||||
_LOGGER.warning("Can't read arch json file from %s", ARCH_JSON)
|
||||
return
|
||||
|
||||
native_support = self.detect_cpu()
|
||||
|
||||
# Evaluate current CPU/Platform
|
||||
if not self.sys_machine or self.sys_machine not in arch_data:
|
||||
_LOGGER.warning("Can't detect underlay machine type!")
|
||||
_LOGGER.warning("Can't detect the machine type!")
|
||||
self._default_arch = native_support
|
||||
self._supported_arch.append(self.default)
|
||||
return
|
||||
|
@ -26,10 +26,10 @@ class Auth(JsonConfig, CoreSysAttributes):
|
||||
password_h = self._rehash(password, username)
|
||||
|
||||
if self._data.get(username_h) == password_h:
|
||||
_LOGGER.info("Cache hit for %s", username)
|
||||
_LOGGER.debug("Username '%s' is in cache", username)
|
||||
return True
|
||||
|
||||
_LOGGER.warning("No cache hit for %s", username)
|
||||
_LOGGER.warning("Username '%s' not is in cache", username)
|
||||
return False
|
||||
|
||||
def _update_cache(self, username: str, password: str) -> None:
|
||||
@ -59,11 +59,11 @@ class Auth(JsonConfig, CoreSysAttributes):
|
||||
if password is None:
|
||||
_LOGGER.error("None as password is not supported!")
|
||||
raise AuthError()
|
||||
_LOGGER.info("Auth request from %s for %s", addon.slug, username)
|
||||
_LOGGER.info("Auth request from '%s' for '%s'", addon.slug, username)
|
||||
|
||||
# Check API state
|
||||
if not await self.sys_homeassistant.api.check_api_state():
|
||||
_LOGGER.info("Home Assistant not running, check cache")
|
||||
_LOGGER.debug("Home Assistant not running, checking cache")
|
||||
return self._check_cache(username, password)
|
||||
|
||||
try:
|
||||
@ -78,11 +78,11 @@ class Auth(JsonConfig, CoreSysAttributes):
|
||||
) as req:
|
||||
|
||||
if req.status == 200:
|
||||
_LOGGER.info("Success login from %s", username)
|
||||
_LOGGER.info("Successful login for '%s'", username)
|
||||
self._update_cache(username, password)
|
||||
return True
|
||||
|
||||
_LOGGER.warning("Wrong login from %s", username)
|
||||
_LOGGER.warning("Unauthorized login for '%s'", username)
|
||||
self._dismatch_cache(username, password)
|
||||
return False
|
||||
except HomeAssistantAPIError:
|
||||
@ -99,10 +99,10 @@ class Auth(JsonConfig, CoreSysAttributes):
|
||||
json={ATTR_USERNAME: username, ATTR_PASSWORD: password},
|
||||
) as req:
|
||||
if req.status == 200:
|
||||
_LOGGER.info("Success password reset %s", username)
|
||||
_LOGGER.info("Successful password reset for '%s'", username)
|
||||
return
|
||||
|
||||
_LOGGER.warning("Unknown user %s for password reset", username)
|
||||
_LOGGER.warning("The user '%s' is not registered", username)
|
||||
except HomeAssistantAPIError:
|
||||
_LOGGER.error("Can't request password reset on Home Assistant!")
|
||||
|
||||
|
@ -96,7 +96,7 @@ async def initialize_coresys() -> CoreSys:
|
||||
coresys.machine = os.environ[ENV_SUPERVISOR_MACHINE]
|
||||
elif os.environ.get(ENV_HOMEASSISTANT_REPOSITORY):
|
||||
coresys.machine = os.environ[ENV_HOMEASSISTANT_REPOSITORY][14:-14]
|
||||
_LOGGER.info("Setup coresys for machine: %s", coresys.machine)
|
||||
_LOGGER.debug("Seting up coresys for machine: %s", coresys.machine)
|
||||
|
||||
return coresys
|
||||
|
||||
@ -107,68 +107,73 @@ def initialize_system_data(coresys: CoreSys) -> None:
|
||||
|
||||
# Home Assistant configuration folder
|
||||
if not config.path_homeassistant.is_dir():
|
||||
_LOGGER.info(
|
||||
"Create Home Assistant configuration folder %s", config.path_homeassistant
|
||||
_LOGGER.debug(
|
||||
"Creating Home Assistant configuration folder at '%s'",
|
||||
config.path_homeassistant,
|
||||
)
|
||||
config.path_homeassistant.mkdir()
|
||||
|
||||
# Supervisor ssl folder
|
||||
if not config.path_ssl.is_dir():
|
||||
_LOGGER.info("Create Supervisor SSL/TLS folder %s", config.path_ssl)
|
||||
_LOGGER.debug("Creating Supervisor SSL/TLS folder at '%s'", config.path_ssl)
|
||||
config.path_ssl.mkdir()
|
||||
|
||||
# Supervisor addon data folder
|
||||
if not config.path_addons_data.is_dir():
|
||||
_LOGGER.info("Create Supervisor Add-on data folder %s", config.path_addons_data)
|
||||
_LOGGER.info(
|
||||
"Creating Supervisor Add-on data folder at '%s'", config.path_addons_data
|
||||
)
|
||||
config.path_addons_data.mkdir(parents=True)
|
||||
|
||||
if not config.path_addons_local.is_dir():
|
||||
_LOGGER.info(
|
||||
"Create Supervisor Add-on local repository folder %s",
|
||||
_LOGGER.debug(
|
||||
"Creating Supervisor Add-on local repository folder at '%s'",
|
||||
config.path_addons_local,
|
||||
)
|
||||
config.path_addons_local.mkdir(parents=True)
|
||||
|
||||
if not config.path_addons_git.is_dir():
|
||||
_LOGGER.info(
|
||||
"Create Supervisor Add-on git repositories folder %s",
|
||||
_LOGGER.debug(
|
||||
"Creating Supervisor Add-on git repositories folder at '%s'",
|
||||
config.path_addons_git,
|
||||
)
|
||||
config.path_addons_git.mkdir(parents=True)
|
||||
|
||||
# Supervisor tmp folder
|
||||
if not config.path_tmp.is_dir():
|
||||
_LOGGER.info("Create Supervisor temp folder %s", config.path_tmp)
|
||||
_LOGGER.debug("Creating Supervisor temp folder at '%s'", config.path_tmp)
|
||||
config.path_tmp.mkdir(parents=True)
|
||||
|
||||
# Supervisor backup folder
|
||||
if not config.path_backup.is_dir():
|
||||
_LOGGER.info("Create Supervisor backup folder %s", config.path_backup)
|
||||
_LOGGER.debug("Creating Supervisor backup folder at '%s'", config.path_backup)
|
||||
config.path_backup.mkdir()
|
||||
|
||||
# Share folder
|
||||
if not config.path_share.is_dir():
|
||||
_LOGGER.info("Create Supervisor share folder %s", config.path_share)
|
||||
_LOGGER.debug("Creating Supervisor share folder at '%s'", config.path_share)
|
||||
config.path_share.mkdir()
|
||||
|
||||
# Apparmor folder
|
||||
if not config.path_apparmor.is_dir():
|
||||
_LOGGER.info("Create Supervisor Apparmor folder %s", config.path_apparmor)
|
||||
_LOGGER.debug(
|
||||
"Creating Supervisor Apparmor folder at '%s'", config.path_apparmor
|
||||
)
|
||||
config.path_apparmor.mkdir()
|
||||
|
||||
# DNS folder
|
||||
if not config.path_dns.is_dir():
|
||||
_LOGGER.info("Create Supervisor DNS folder %s", config.path_dns)
|
||||
_LOGGER.debug("Creating Supervisor DNS folder at '%s'", config.path_dns)
|
||||
config.path_dns.mkdir()
|
||||
|
||||
# Audio folder
|
||||
if not config.path_audio.is_dir():
|
||||
_LOGGER.info("Create Supervisor audio folder %s", config.path_audio)
|
||||
_LOGGER.debug("Creating Supervisor audio folder at '%s'", config.path_audio)
|
||||
config.path_audio.mkdir()
|
||||
|
||||
# Media folder
|
||||
if not config.path_media.is_dir():
|
||||
_LOGGER.info("Create Supervisor media folder %s", config.path_media)
|
||||
_LOGGER.debug("Creating Supervisor media folder at '%s'", config.path_media)
|
||||
config.path_media.mkdir()
|
||||
|
||||
# Update log level
|
||||
@ -176,7 +181,7 @@ def initialize_system_data(coresys: CoreSys) -> None:
|
||||
|
||||
# Check if ENV is in development mode
|
||||
if bool(os.environ.get(ENV_SUPERVISOR_DEV, 0)):
|
||||
_LOGGER.warning("SUPERVISOR_DEV is set")
|
||||
_LOGGER.warning("Environment variables 'SUPERVISOR_DEV' is set")
|
||||
coresys.updater.channel = UpdateChannel.DEV
|
||||
coresys.config.logging = LogLevel.DEBUG
|
||||
coresys.config.debug = True
|
||||
@ -192,7 +197,7 @@ def migrate_system_env(coresys: CoreSys) -> None:
|
||||
try:
|
||||
old_build.rmdir()
|
||||
except OSError:
|
||||
_LOGGER.warning("Can't cleanup old Add-on build directory")
|
||||
_LOGGER.error("Can't cleanup old Add-on build directory at '%s'", old_build)
|
||||
|
||||
|
||||
def initialize_logging() -> None:
|
||||
@ -228,7 +233,7 @@ def check_environment() -> None:
|
||||
try:
|
||||
os.environ[key]
|
||||
except KeyError:
|
||||
_LOGGER.critical("Can't find %s in env!", key)
|
||||
_LOGGER.critical("Can't find '%s' environment variable!", key)
|
||||
|
||||
# Check Machine info
|
||||
if not os.environ.get(ENV_HOMEASSISTANT_REPOSITORY) and not os.environ.get(
|
||||
@ -278,11 +283,11 @@ def supervisor_debugger(coresys: CoreSys) -> None:
|
||||
# pylint: disable=import-outside-toplevel
|
||||
import debugpy
|
||||
|
||||
_LOGGER.info("Initialize Supervisor debugger")
|
||||
_LOGGER.info("Initializing Supervisor debugger")
|
||||
|
||||
debugpy.listen(("0.0.0.0", 33333))
|
||||
if coresys.config.debug_block:
|
||||
_LOGGER.info("Wait until debugger is attached")
|
||||
_LOGGER.debug("Wait until debugger is attached")
|
||||
debugpy.wait_for_client()
|
||||
|
||||
|
||||
@ -292,7 +297,7 @@ def setup_diagnostics(coresys: CoreSys) -> None:
|
||||
level=logging.WARNING, event_level=logging.CRITICAL
|
||||
)
|
||||
|
||||
_LOGGER.info("Initialize Supervisor Sentry")
|
||||
_LOGGER.info("Initializing Supervisor Sentry")
|
||||
sentry_sdk.init(
|
||||
dsn="https://9c6ea70f49234442b4746e447b24747e@o427061.ingest.sentry.io/5370612",
|
||||
before_send=lambda event, hint: filter_data(coresys, event, hint),
|
||||
|
@ -52,7 +52,9 @@ class Core(CoreSysAttributes):
|
||||
try:
|
||||
RUN_SUPERVISOR_STATE.write_text(new_state.value)
|
||||
except OSError as err:
|
||||
_LOGGER.warning("Can't update supervisor state %s: %s", new_state, err)
|
||||
_LOGGER.warning(
|
||||
"Can't update the Supervisor state to %s: %s", new_state, err
|
||||
)
|
||||
finally:
|
||||
self._state = new_state
|
||||
|
||||
@ -68,7 +70,7 @@ class Core(CoreSysAttributes):
|
||||
self.sys_resolution.unsupported = UnsupportedReason.DOCKER_VERSION
|
||||
self.healthy = False
|
||||
_LOGGER.error(
|
||||
"Docker version %s is not supported by Supervisor!",
|
||||
"Docker version '%s' is not supported by Supervisor!",
|
||||
self.sys_docker.info.version,
|
||||
)
|
||||
elif self.sys_docker.info.inside_lxc:
|
||||
@ -89,7 +91,7 @@ class Core(CoreSysAttributes):
|
||||
if not SOCKET_DBUS.exists():
|
||||
self.sys_resolution.unsupported = UnsupportedReason.DBUS
|
||||
_LOGGER.error(
|
||||
"DBus is required for Home Assistant. This system is not supported!"
|
||||
"D-Bus is required for Home Assistant. This system is not supported!"
|
||||
)
|
||||
|
||||
# Check supervisor version/update
|
||||
@ -101,13 +103,13 @@ class Core(CoreSysAttributes):
|
||||
):
|
||||
self.healthy = False
|
||||
_LOGGER.warning(
|
||||
"Found a development supervisor outside dev channel (%s)",
|
||||
"Found a development Supervisor outside dev channel (%s)",
|
||||
self.sys_updater.channel,
|
||||
)
|
||||
elif self.sys_config.version != self.sys_supervisor.version:
|
||||
self.healthy = False
|
||||
_LOGGER.error(
|
||||
"Update %s of Supervisor %s failed!",
|
||||
"Update '%s' of Supervisor '%s' failed!",
|
||||
self.sys_config.version,
|
||||
self.sys_supervisor.version,
|
||||
)
|
||||
@ -174,7 +176,7 @@ class Core(CoreSysAttributes):
|
||||
# Check Host features
|
||||
if HostFeature.NETWORK not in self.sys_host.supported_features:
|
||||
self.sys_resolution.unsupported = UnsupportedReason.NETWORK_MANAGER
|
||||
_LOGGER.error("NetworkManager is not correct working")
|
||||
_LOGGER.error("NetworkManager is not correctly configured")
|
||||
if any(
|
||||
feature not in self.sys_host.supported_features
|
||||
for feature in (
|
||||
@ -185,7 +187,7 @@ class Core(CoreSysAttributes):
|
||||
)
|
||||
):
|
||||
self.sys_resolution.unsupported = UnsupportedReason.SYSTEMD
|
||||
_LOGGER.error("Systemd is not correct working")
|
||||
_LOGGER.error("Systemd is not correctly working")
|
||||
|
||||
# Check if image names from denylist exist
|
||||
try:
|
||||
@ -201,7 +203,7 @@ class Core(CoreSysAttributes):
|
||||
|
||||
# Check if system is healthy
|
||||
if not self.supported:
|
||||
_LOGGER.critical("System running in a unsupported environment!")
|
||||
_LOGGER.warning("System running in a unsupported environment!")
|
||||
if not self.healthy:
|
||||
_LOGGER.critical(
|
||||
"System running in a unhealthy state and need manual intervention!"
|
||||
@ -215,13 +217,13 @@ class Core(CoreSysAttributes):
|
||||
if self.sys_supervisor.need_update:
|
||||
try:
|
||||
if self.sys_dev or not self.healthy:
|
||||
_LOGGER.warning("Ignore Supervisor updates!")
|
||||
_LOGGER.warning("Ignoring Supervisor updates!")
|
||||
else:
|
||||
await self.sys_supervisor.update()
|
||||
return
|
||||
except SupervisorUpdateError as err:
|
||||
_LOGGER.critical(
|
||||
"Can't update supervisor! This will break some Add-ons or affect "
|
||||
"Can't update Supervisor! This will break some Add-ons or affect "
|
||||
"future version of Home Assistant!"
|
||||
)
|
||||
self.sys_capture_exception(err)
|
||||
@ -232,7 +234,7 @@ class Core(CoreSysAttributes):
|
||||
try:
|
||||
# HomeAssistant is already running / supervisor have only reboot
|
||||
if self.sys_hardware.last_boot == self.sys_config.last_boot:
|
||||
_LOGGER.info("Supervisor reboot detected")
|
||||
_LOGGER.debug("Supervisor reboot detected")
|
||||
return
|
||||
|
||||
# reset register services / discovery
|
||||
@ -252,7 +254,7 @@ class Core(CoreSysAttributes):
|
||||
try:
|
||||
await self.sys_homeassistant.core.start()
|
||||
except HomeAssistantCrashError as err:
|
||||
_LOGGER.warning("Can't start Home Assistant Core - rebuild")
|
||||
_LOGGER.error("Can't start Home Assistant Core - rebuiling")
|
||||
self.sys_capture_exception(err)
|
||||
|
||||
with suppress(HomeAssistantError):
|
||||
@ -260,7 +262,7 @@ class Core(CoreSysAttributes):
|
||||
except HomeAssistantError as err:
|
||||
self.sys_capture_exception(err)
|
||||
else:
|
||||
_LOGGER.info("Skip start of Home Assistant")
|
||||
_LOGGER.debug("Skiping start of Home Assistant")
|
||||
|
||||
# start addon mark as application
|
||||
await self.sys_addons.boot(AddonStartup.APPLICATION)
|
||||
@ -283,8 +285,8 @@ class Core(CoreSysAttributes):
|
||||
self.sys_create_task(self.sys_host.reload())
|
||||
self.sys_create_task(self.sys_updater.reload())
|
||||
|
||||
_LOGGER.info("Supervisor is up and running")
|
||||
self.state = CoreState.RUNNING
|
||||
_LOGGER.info("Supervisor is up and running")
|
||||
|
||||
async def stop(self):
|
||||
"""Stop a running orchestration."""
|
||||
@ -318,8 +320,8 @@ class Core(CoreSysAttributes):
|
||||
except asyncio.TimeoutError:
|
||||
_LOGGER.warning("Stage 2: Force Shutdown!")
|
||||
|
||||
_LOGGER.info("Supervisor is down")
|
||||
self.state = CoreState.CLOSE
|
||||
_LOGGER.info("Supervisor is down")
|
||||
self.sys_loop.stop()
|
||||
|
||||
async def shutdown(self):
|
||||
@ -351,7 +353,7 @@ class Core(CoreSysAttributes):
|
||||
|
||||
async def repair(self):
|
||||
"""Repair system integrity."""
|
||||
_LOGGER.info("Start repairing of Supervisor Environment")
|
||||
_LOGGER.info("Starting repair of Supervisor Environment")
|
||||
await self.sys_run_in_executor(self.sys_docker.repair)
|
||||
|
||||
# Fix plugins
|
||||
@ -363,4 +365,4 @@ class Core(CoreSysAttributes):
|
||||
|
||||
# Tag version for latest
|
||||
await self.sys_supervisor.repair()
|
||||
_LOGGER.info("Finished repairing of Supervisor Environment")
|
||||
_LOGGER.info("Finished repair of Supervisor Environment")
|
||||
|
@ -53,5 +53,5 @@ class DBusManager(CoreSysAttributes):
|
||||
await self.network.connect()
|
||||
except DBusNotConnectedError:
|
||||
_LOGGER.error(
|
||||
"No DBus support from Host. Disabled any kind of host control!"
|
||||
"No D-Bus support on Host. Disabled any kind of host control!"
|
||||
)
|
||||
|
@ -51,7 +51,7 @@ class Discovery(CoreSysAttributes, JsonConfig):
|
||||
discovery = Message(**message)
|
||||
messages[discovery.uuid] = discovery
|
||||
|
||||
_LOGGER.info("Load %d messages", len(messages))
|
||||
_LOGGER.info("Loaded %d messages", len(messages))
|
||||
self.message_obj = messages
|
||||
|
||||
def save(self) -> None:
|
||||
@ -96,7 +96,9 @@ class Discovery(CoreSysAttributes, JsonConfig):
|
||||
return exists_msg
|
||||
break
|
||||
|
||||
_LOGGER.info("Send discovery to Home Assistant %s from %s", service, addon.slug)
|
||||
_LOGGER.info(
|
||||
"Sending discovery to Home Assistant %s from %s", service, addon.slug
|
||||
)
|
||||
self.message_obj[message.uuid] = message
|
||||
self.save()
|
||||
|
||||
|
@ -167,7 +167,7 @@ class DockerAPI:
|
||||
try:
|
||||
self.network.attach_container(container, alias=alias, ipv4=ipv4)
|
||||
except DockerError:
|
||||
_LOGGER.warning("Can't attach %s to hassio-net!", name)
|
||||
_LOGGER.warning("Can't attach %s to hassio-network!", name)
|
||||
else:
|
||||
with suppress(DockerError):
|
||||
self.network.detach_default_bridge(container)
|
||||
@ -202,7 +202,7 @@ class DockerAPI:
|
||||
stdout = kwargs.get("stdout", True)
|
||||
stderr = kwargs.get("stderr", True)
|
||||
|
||||
_LOGGER.info("Run command '%s' on %s", command, image)
|
||||
_LOGGER.info("Runing command '%s' on %s", command, image)
|
||||
try:
|
||||
container = self.docker.containers.run(
|
||||
f"{image}:{version}",
|
||||
|
@ -347,7 +347,7 @@ class DockerAddon(DockerInterface):
|
||||
|
||||
# Security check
|
||||
if not self.addon.protected:
|
||||
_LOGGER.warning("%s run with disabled protected mode!", self.addon.name)
|
||||
_LOGGER.warning("%s running with disabled protected mode!", self.addon.name)
|
||||
|
||||
# Cleanup
|
||||
self._stop()
|
||||
@ -376,7 +376,9 @@ class DockerAddon(DockerInterface):
|
||||
)
|
||||
|
||||
self._meta = docker_container.attrs
|
||||
_LOGGER.info("Start Docker add-on %s with version %s", self.image, self.version)
|
||||
_LOGGER.info(
|
||||
"Starting Docker add-on %s with version %s", self.image, self.version
|
||||
)
|
||||
|
||||
# Write data to DNS server
|
||||
try:
|
||||
@ -406,7 +408,7 @@ class DockerAddon(DockerInterface):
|
||||
"""
|
||||
build_env = AddonBuild(self.coresys, self.addon)
|
||||
|
||||
_LOGGER.info("Start build %s:%s", self.image, tag)
|
||||
_LOGGER.info("Starting build for %s:%s", self.image, tag)
|
||||
try:
|
||||
image, log = self.sys_docker.images.build(
|
||||
use_config_proxy=False, **build_env.get_docker_args(tag)
|
||||
@ -470,7 +472,7 @@ class DockerAddon(DockerInterface):
|
||||
raise DockerError() from err
|
||||
|
||||
self._meta = docker_image.attrs
|
||||
_LOGGER.info("Import image %s and version %s", tar_file, self.version)
|
||||
_LOGGER.info("Importing image %s and version %s", tar_file, self.version)
|
||||
|
||||
with suppress(DockerError):
|
||||
self._cleanup()
|
||||
|
@ -41,7 +41,7 @@ class DockerAudio(DockerInterface, CoreSysAttributes):
|
||||
if Path("/dev/snd").exists():
|
||||
volumes.update({"/dev/snd": {"bind": "/dev/snd", "mode": "rw"}})
|
||||
else:
|
||||
_LOGGER.warning("Kernel have no audio support in")
|
||||
_LOGGER.warning("Kernel have no audio support")
|
||||
|
||||
return volumes
|
||||
|
||||
@ -72,7 +72,7 @@ class DockerAudio(DockerInterface, CoreSysAttributes):
|
||||
|
||||
self._meta = docker_container.attrs
|
||||
_LOGGER.info(
|
||||
"Start Audio %s with version %s - %s",
|
||||
"Starting Audio %s with version %s - %s",
|
||||
self.image,
|
||||
self.version,
|
||||
self.sys_docker.network.audio,
|
||||
|
@ -57,7 +57,7 @@ class DockerCli(DockerInterface, CoreSysAttributes):
|
||||
|
||||
self._meta = docker_container.attrs
|
||||
_LOGGER.info(
|
||||
"Start CLI %s with version %s - %s",
|
||||
"Starting CLI %s with version %s - %s",
|
||||
self.image,
|
||||
self.version,
|
||||
self.sys_docker.network.cli,
|
||||
|
@ -52,7 +52,7 @@ class DockerDNS(DockerInterface, CoreSysAttributes):
|
||||
|
||||
self._meta = docker_container.attrs
|
||||
_LOGGER.info(
|
||||
"Start DNS %s with version %s - %s",
|
||||
"Starting DNS %s with version %s - %s",
|
||||
self.image,
|
||||
self.version,
|
||||
self.sys_docker.network.dns,
|
||||
|
@ -129,7 +129,9 @@ class DockerHomeAssistant(DockerInterface):
|
||||
)
|
||||
|
||||
self._meta = docker_container.attrs
|
||||
_LOGGER.info("Start homeassistant %s with version %s", self.image, self.version)
|
||||
_LOGGER.info(
|
||||
"Starting Home Assistant %s with version %s", self.image, self.version
|
||||
)
|
||||
|
||||
def _execute_command(self, command: str) -> CommandReturn:
|
||||
"""Create a temporary container and run command.
|
||||
|
@ -107,7 +107,7 @@ class DockerInterface(CoreSysAttributes):
|
||||
"""
|
||||
image = image or self.image
|
||||
|
||||
_LOGGER.info("Pull image %s tag %s.", image, tag)
|
||||
_LOGGER.info("Downloading docker image %s with tag %s.", image, tag)
|
||||
try:
|
||||
# If the image name contains a path to a registry, try to log in
|
||||
path = IMAGE_WITH_HOST.match(image)
|
||||
@ -115,7 +115,7 @@ class DockerInterface(CoreSysAttributes):
|
||||
self._docker_login(path.group(1))
|
||||
docker_image = self.sys_docker.images.pull(f"{image}:{tag}")
|
||||
if latest:
|
||||
_LOGGER.info("Tag image %s with version %s as latest", image, tag)
|
||||
_LOGGER.info("Tagging image %s with version %s as latest", image, tag)
|
||||
docker_image.tag(image, tag="latest")
|
||||
except docker.errors.APIError as err:
|
||||
_LOGGER.error("Can't install %s:%s -> %s.", image, tag, err)
|
||||
@ -191,7 +191,7 @@ class DockerInterface(CoreSysAttributes):
|
||||
# Successfull?
|
||||
if not self._meta:
|
||||
raise DockerError()
|
||||
_LOGGER.info("Attach to %s with version %s", self.image, self.version)
|
||||
_LOGGER.info("Attaching to %s with version %s", self.image, self.version)
|
||||
|
||||
@process_lock
|
||||
def run(self) -> Awaitable[None]:
|
||||
@ -223,13 +223,13 @@ class DockerInterface(CoreSysAttributes):
|
||||
raise DockerError() from err
|
||||
|
||||
if docker_container.status == "running":
|
||||
_LOGGER.info("Stop %s application", self.name)
|
||||
_LOGGER.info("Stopping %s application", self.name)
|
||||
with suppress(docker.errors.DockerException, requests.RequestException):
|
||||
docker_container.stop(timeout=self.timeout)
|
||||
|
||||
if remove_container:
|
||||
with suppress(docker.errors.DockerException, requests.RequestException):
|
||||
_LOGGER.info("Clean %s application", self.name)
|
||||
_LOGGER.info("Cleaning %s application", self.name)
|
||||
docker_container.remove(force=True)
|
||||
|
||||
@process_lock
|
||||
@ -248,7 +248,7 @@ class DockerInterface(CoreSysAttributes):
|
||||
_LOGGER.error("%s not found for starting up", self.name)
|
||||
raise DockerError() from err
|
||||
|
||||
_LOGGER.info("Start %s", self.name)
|
||||
_LOGGER.info("Starting %s", self.name)
|
||||
try:
|
||||
docker_container.start()
|
||||
except (docker.errors.DockerException, requests.RequestException) as err:
|
||||
@ -269,7 +269,7 @@ class DockerInterface(CoreSysAttributes):
|
||||
with suppress(DockerError):
|
||||
self._stop()
|
||||
|
||||
_LOGGER.info("Remove image %s with latest and %s", self.image, self.version)
|
||||
_LOGGER.info("Removeing image %s with latest and %s", self.image, self.version)
|
||||
|
||||
try:
|
||||
with suppress(docker.errors.ImageNotFound):
|
||||
@ -303,7 +303,7 @@ class DockerInterface(CoreSysAttributes):
|
||||
image = image or self.image
|
||||
|
||||
_LOGGER.info(
|
||||
"Update image %s:%s to %s:%s", self.image, self.version, image, tag
|
||||
"Updateing image %s:%s to %s:%s", self.image, self.version, image, tag
|
||||
)
|
||||
|
||||
# Update docker image
|
||||
@ -398,7 +398,7 @@ class DockerInterface(CoreSysAttributes):
|
||||
except (docker.errors.DockerException, requests.RequestException) as err:
|
||||
raise DockerError() from err
|
||||
|
||||
_LOGGER.info("Restart %s", self.image)
|
||||
_LOGGER.info("Restarting %s", self.image)
|
||||
try:
|
||||
container.restart(timeout=self.timeout)
|
||||
except (docker.errors.DockerException, requests.RequestException) as err:
|
||||
|
@ -49,5 +49,5 @@ class DockerMulticast(DockerInterface, CoreSysAttributes):
|
||||
|
||||
self._meta = docker_container.attrs
|
||||
_LOGGER.info(
|
||||
"Start Multicast %s with version %s - Host", self.image, self.version
|
||||
"Starting Multicast %s with version %s - Host", self.image, self.version
|
||||
)
|
||||
|
@ -37,7 +37,7 @@ class DockerNetwork:
|
||||
try:
|
||||
containers.append(self.docker.containers.get(cid))
|
||||
except docker.errors.NotFound:
|
||||
_LOGGER.warning("Docker network is corrupt! %s - run autofix", cid)
|
||||
_LOGGER.warning("Docker network is corrupt! %s - running autofix", cid)
|
||||
self.stale_cleanup(data.get("Name", cid))
|
||||
except (docker.errors.DockerException, requests.RequestException) as err:
|
||||
_LOGGER.error("Unknown error with container lookup %s", err)
|
||||
@ -79,7 +79,7 @@ class DockerNetwork:
|
||||
try:
|
||||
return self.docker.networks.get(DOCKER_NETWORK)
|
||||
except docker.errors.NotFound:
|
||||
_LOGGER.info("Can't find Supervisor network, create new network")
|
||||
_LOGGER.info("Can't find Supervisor network, creating a new network")
|
||||
|
||||
ipam_pool = docker.types.IPAMPool(
|
||||
subnet=str(DOCKER_NETWORK_MASK),
|
||||
|
@ -57,7 +57,7 @@ class DockerObserver(DockerInterface, CoreSysAttributes):
|
||||
|
||||
self._meta = docker_container.attrs
|
||||
_LOGGER.info(
|
||||
"Start Observer %s with version %s - %s",
|
||||
"Starting Observer %s with version %s - %s",
|
||||
self.image,
|
||||
self.version,
|
||||
self.sys_docker.network.observer,
|
||||
|
@ -44,7 +44,7 @@ class DockerSupervisor(DockerInterface, CoreSysAttributes):
|
||||
|
||||
self._meta = docker_container.attrs
|
||||
_LOGGER.info(
|
||||
"Attach to Supervisor %s with version %s",
|
||||
"Attaching to Supervisor %s with version %s",
|
||||
self.image,
|
||||
self.sys_supervisor.version,
|
||||
)
|
||||
@ -54,7 +54,7 @@ class DockerSupervisor(DockerInterface, CoreSysAttributes):
|
||||
return
|
||||
|
||||
# Attach to network
|
||||
_LOGGER.info("Connect Supervisor to hassio Network")
|
||||
_LOGGER.info("Connecting Supervisor to hassio-network")
|
||||
self.sys_docker.network.attach_container(
|
||||
docker_container,
|
||||
alias=["supervisor"],
|
||||
@ -76,7 +76,7 @@ class DockerSupervisor(DockerInterface, CoreSysAttributes):
|
||||
docker_container.image.tag(self.image, tag=self.version)
|
||||
docker_container.image.tag(self.image, tag="latest")
|
||||
except (docker.errors.DockerException, requests.RequestException) as err:
|
||||
_LOGGER.error("Can't retag supervisor version: %s", err)
|
||||
_LOGGER.error("Can't retag Supervisor version: %s", err)
|
||||
raise DockerError() from err
|
||||
|
||||
def update_start_tag(self, image: str, version: str) -> Awaitable[None]:
|
||||
|
@ -53,7 +53,7 @@ class HassOS(CoreSysAttributes):
|
||||
def _check_host(self) -> None:
|
||||
"""Check if HassOS is available."""
|
||||
if not self.available:
|
||||
_LOGGER.error("No HassOS available")
|
||||
_LOGGER.error("No Home Assistant Operating System available")
|
||||
raise HassOSNotSupportedError()
|
||||
|
||||
async def _download_raucb(self, version: str) -> Path:
|
||||
@ -119,7 +119,9 @@ class HassOS(CoreSysAttributes):
|
||||
"""
|
||||
self._check_host()
|
||||
|
||||
_LOGGER.info("Syncing configuration from USB with HassOS.")
|
||||
_LOGGER.info(
|
||||
"Synchronizing configuration from USB with Home Assistant Operating System."
|
||||
)
|
||||
return self.sys_host.services.restart("hassos-config.service")
|
||||
|
||||
async def update(self, version: Optional[str] = None) -> None:
|
||||
@ -149,13 +151,18 @@ class HassOS(CoreSysAttributes):
|
||||
|
||||
# Update success
|
||||
if 0 in completed:
|
||||
_LOGGER.info("Install HassOS %s success", version)
|
||||
_LOGGER.info(
|
||||
"Install of Home Assistant Operating System %s success", version
|
||||
)
|
||||
self.sys_create_task(self.sys_host.control.reboot())
|
||||
return
|
||||
|
||||
# Update failed
|
||||
await self.sys_dbus.rauc.update()
|
||||
_LOGGER.error("HassOS update failed with: %s", self.sys_dbus.rauc.last_error)
|
||||
_LOGGER.error(
|
||||
"Home Assistant Operating System update failed with: %s",
|
||||
self.sys_dbus.rauc.last_error,
|
||||
)
|
||||
raise HassOSUpdateError()
|
||||
|
||||
async def mark_healthy(self) -> None:
|
||||
|
@ -76,7 +76,7 @@ class HomeAssistantCore(CoreSysAttributes):
|
||||
@process_lock
|
||||
async def install_landingpage(self) -> None:
|
||||
"""Install a landing page."""
|
||||
_LOGGER.info("Setup HomeAssistant landingpage")
|
||||
_LOGGER.info("Setting up Home Assistant landingpage")
|
||||
while True:
|
||||
if not self.sys_updater.image_homeassistant:
|
||||
_LOGGER.warning(
|
||||
@ -102,14 +102,14 @@ class HomeAssistantCore(CoreSysAttributes):
|
||||
break
|
||||
|
||||
# Start landingpage
|
||||
_LOGGER.info("Start HomeAssistant landingpage")
|
||||
_LOGGER.info("Starting HomeAssistant landingpage")
|
||||
with suppress(HomeAssistantError):
|
||||
await self._start()
|
||||
|
||||
@process_lock
|
||||
async def install(self) -> None:
|
||||
"""Install a landing page."""
|
||||
_LOGGER.info("Setup Home Assistant")
|
||||
_LOGGER.info("Home Assistant setup")
|
||||
while True:
|
||||
# read homeassistant tag and install it
|
||||
if not self.sys_homeassistant.latest_version:
|
||||
@ -127,7 +127,7 @@ class HomeAssistantCore(CoreSysAttributes):
|
||||
except Exception as err: # pylint: disable=broad-except
|
||||
self.sys_capture_exception(err)
|
||||
|
||||
_LOGGER.warning("Error on install Home Assistant. Retry in 30sec")
|
||||
_LOGGER.warning("Error on Home Assistant installation. Retry in 30sec")
|
||||
await asyncio.sleep(30)
|
||||
|
||||
_LOGGER.info("Home Assistant docker now installed")
|
||||
@ -137,7 +137,7 @@ class HomeAssistantCore(CoreSysAttributes):
|
||||
|
||||
# finishing
|
||||
try:
|
||||
_LOGGER.info("Start Home Assistant")
|
||||
_LOGGER.info("Starting Home Assistant")
|
||||
await self._start()
|
||||
except HomeAssistantError:
|
||||
_LOGGER.error("Can't start Home Assistant!")
|
||||
@ -162,13 +162,13 @@ class HomeAssistantCore(CoreSysAttributes):
|
||||
# process an update
|
||||
async def _update(to_version: str) -> None:
|
||||
"""Run Home Assistant update."""
|
||||
_LOGGER.info("Update Home Assistant to version %s", to_version)
|
||||
_LOGGER.info("Updating Home Assistant to version %s", to_version)
|
||||
try:
|
||||
await self.instance.update(
|
||||
to_version, image=self.sys_updater.image_homeassistant
|
||||
)
|
||||
except DockerError as err:
|
||||
_LOGGER.warning("Update Home Assistant image failed")
|
||||
_LOGGER.warning("Updating Home Assistant image failed")
|
||||
raise HomeAssistantUpdateError() from err
|
||||
else:
|
||||
self.sys_homeassistant.version = self.instance.version
|
||||
@ -176,7 +176,7 @@ class HomeAssistantCore(CoreSysAttributes):
|
||||
|
||||
if running:
|
||||
await self._start()
|
||||
_LOGGER.info("Successful run Home Assistant %s", to_version)
|
||||
_LOGGER.info("Successful started Home Assistant %s", to_version)
|
||||
|
||||
# Successfull - last step
|
||||
self.sys_homeassistant.save_data()
|
||||
|
@ -34,7 +34,7 @@ class HomeAssistantSecrets(CoreSysAttributes):
|
||||
"""Load secrets on start."""
|
||||
await self._read_secrets()
|
||||
|
||||
_LOGGER.info("Load Home Assistant secrets: %s", len(self.secrets))
|
||||
_LOGGER.info("Loaded %s Home Assistant secrets", len(self.secrets))
|
||||
|
||||
async def reload(self) -> None:
|
||||
"""Reload secrets."""
|
||||
@ -61,4 +61,4 @@ class HomeAssistantSecrets(CoreSysAttributes):
|
||||
except (YAMLError, AttributeError) as err:
|
||||
_LOGGER.error("Can't process Home Assistant secrets: %s", err)
|
||||
else:
|
||||
_LOGGER.debug("Reload Home Assistant secrets: %s", len(self.secrets))
|
||||
_LOGGER.debug("Reloading Home Assistant secrets: %s", len(self.secrets))
|
||||
|
@ -103,4 +103,4 @@ class HostManager(CoreSysAttributes):
|
||||
try:
|
||||
await self.apparmor.load()
|
||||
except HassioError as err:
|
||||
_LOGGER.warning("Load host AppArmor on start failed: %s", err)
|
||||
_LOGGER.warning("Loading host AppArmor on start failed: %s", err)
|
||||
|
@ -52,7 +52,7 @@ class AppArmorControl(CoreSysAttributes):
|
||||
self._profiles.add(content.name)
|
||||
|
||||
# Is connected with systemd?
|
||||
_LOGGER.info("Load AppArmor Profiles: %s", self._profiles)
|
||||
_LOGGER.info("Loading AppArmor Profiles: %s", self._profiles)
|
||||
for service in SYSTEMD_SERVICES:
|
||||
if not self.sys_host.services.exists(service):
|
||||
continue
|
||||
@ -67,7 +67,7 @@ class AppArmorControl(CoreSysAttributes):
|
||||
async def load_profile(self, profile_name, profile_file):
|
||||
"""Load/Update a new/exists profile into AppArmor."""
|
||||
if not validate_profile(profile_name, profile_file):
|
||||
_LOGGER.error("Profile is not valid with name %s", profile_name)
|
||||
_LOGGER.error("AppArmor profile '%s' is not valid", profile_name)
|
||||
raise HostAppArmorError()
|
||||
|
||||
# Copy to AppArmor folder
|
||||
@ -79,7 +79,7 @@ class AppArmorControl(CoreSysAttributes):
|
||||
raise HostAppArmorError() from err
|
||||
|
||||
# Load profiles
|
||||
_LOGGER.info("Add or Update AppArmor profile: %s", profile_name)
|
||||
_LOGGER.info("Adding/updating AppArmor profile: %s", profile_name)
|
||||
self._profiles.add(profile_name)
|
||||
if self.available:
|
||||
await self._reload_service()
|
||||
@ -105,7 +105,7 @@ class AppArmorControl(CoreSysAttributes):
|
||||
_LOGGER.error("Can't mark profile as remove: %s", err)
|
||||
raise HostAppArmorError() from err
|
||||
|
||||
_LOGGER.info("Remove AppArmor profile: %s", profile_name)
|
||||
_LOGGER.info("Removing AppArmor profile: %s", profile_name)
|
||||
self._profiles.remove(profile_name)
|
||||
await self._reload_service()
|
||||
|
||||
|
@ -89,7 +89,7 @@ class InfoCenter(CoreSysAttributes):
|
||||
|
||||
async def update(self):
|
||||
"""Update properties over dbus."""
|
||||
_LOGGER.info("Update local host information")
|
||||
_LOGGER.info("Updating local host information")
|
||||
try:
|
||||
await self.sys_dbus.hostname.update()
|
||||
except DBusError:
|
||||
|
@ -36,7 +36,7 @@ class NetworkManager(CoreSysAttributes):
|
||||
|
||||
async def update(self):
|
||||
"""Update properties over dbus."""
|
||||
_LOGGER.info("Update local network information")
|
||||
_LOGGER.info("Updating local network information")
|
||||
try:
|
||||
await self.sys_dbus.network.update()
|
||||
except DBusError:
|
||||
|
@ -26,7 +26,7 @@ class ServiceManager(CoreSysAttributes):
|
||||
def _check_dbus(self, unit=None):
|
||||
"""Check available dbus connection."""
|
||||
if not self.sys_dbus.systemd.is_connected:
|
||||
_LOGGER.error("No systemd dbus connection available")
|
||||
_LOGGER.error("No systemd D-Bus connection available")
|
||||
raise HostNotSupportedError()
|
||||
|
||||
if unit and not self.exists(unit):
|
||||
@ -37,28 +37,28 @@ class ServiceManager(CoreSysAttributes):
|
||||
"""Start a service on host."""
|
||||
self._check_dbus(unit)
|
||||
|
||||
_LOGGER.info("Start local service %s", unit)
|
||||
_LOGGER.info("Starting local service %s", unit)
|
||||
return self.sys_dbus.systemd.start_unit(unit, MOD_REPLACE)
|
||||
|
||||
def stop(self, unit):
|
||||
"""Stop a service on host."""
|
||||
self._check_dbus(unit)
|
||||
|
||||
_LOGGER.info("Stop local service %s", unit)
|
||||
_LOGGER.info("Stopping local service %s", unit)
|
||||
return self.sys_dbus.systemd.stop_unit(unit, MOD_REPLACE)
|
||||
|
||||
def reload(self, unit):
|
||||
"""Reload a service on host."""
|
||||
self._check_dbus(unit)
|
||||
|
||||
_LOGGER.info("Reload local service %s", unit)
|
||||
_LOGGER.info("Reloading local service %s", unit)
|
||||
return self.sys_dbus.systemd.reload_unit(unit, MOD_REPLACE)
|
||||
|
||||
def restart(self, unit):
|
||||
"""Restart a service on host."""
|
||||
self._check_dbus(unit)
|
||||
|
||||
_LOGGER.info("Restart local service %s", unit)
|
||||
_LOGGER.info("Restarting local service %s", unit)
|
||||
return self.sys_dbus.systemd.restart_unit(unit, MOD_REPLACE)
|
||||
|
||||
def exists(self, unit):
|
||||
@ -72,7 +72,7 @@ class ServiceManager(CoreSysAttributes):
|
||||
"""Update properties over dbus."""
|
||||
self._check_dbus()
|
||||
|
||||
_LOGGER.info("Update service information")
|
||||
_LOGGER.info("Updating service information")
|
||||
self._services.clear()
|
||||
try:
|
||||
systemd_units = await self.sys_dbus.systemd.list_units()
|
||||
|
@ -220,7 +220,7 @@ class SoundControl(CoreSysAttributes):
|
||||
@AsyncThrottle(timedelta(seconds=10))
|
||||
async def update(self):
|
||||
"""Update properties over dbus."""
|
||||
_LOGGER.info("Update PulseAudio information")
|
||||
_LOGGER.info("Updating PulseAudio information")
|
||||
|
||||
def _update():
|
||||
try:
|
||||
|
@ -56,7 +56,7 @@ class Ingress(JsonConfig, CoreSysAttributes):
|
||||
self._update_token_list()
|
||||
self._cleanup_sessions()
|
||||
|
||||
_LOGGER.info("Load %d ingress session", len(self.sessions))
|
||||
_LOGGER.info("Loaded %d ingress sessions", len(self.sessions))
|
||||
|
||||
async def reload(self) -> None:
|
||||
"""Reload/Validate sessions."""
|
||||
@ -157,7 +157,7 @@ class Ingress(JsonConfig, CoreSysAttributes):
|
||||
async def update_hass_panel(self, addon: Addon):
|
||||
"""Return True if Home Assistant up and running."""
|
||||
if not await self.sys_homeassistant.core.is_running():
|
||||
_LOGGER.debug("Ignore panel update on Core")
|
||||
_LOGGER.debug("Ignoring panel update on Core")
|
||||
return
|
||||
|
||||
# Update UI
|
||||
|
@ -40,7 +40,7 @@ class HwMonitor(CoreSysAttributes):
|
||||
return
|
||||
|
||||
self.observer.stop()
|
||||
_LOGGER.info("Stop Supervisor hardware monitor")
|
||||
_LOGGER.info("Stopped Supervisor hardware monitor")
|
||||
|
||||
def _udev_events(self, action: str, device: pyudev.Device):
|
||||
"""Incomming events from udev.
|
||||
@ -59,5 +59,5 @@ class HwMonitor(CoreSysAttributes):
|
||||
@AsyncCallFilter(timedelta(seconds=5))
|
||||
def _action_sound(self, device: pyudev.Device):
|
||||
"""Process sound actions."""
|
||||
_LOGGER.info("Detect changed audio hardware")
|
||||
_LOGGER.info("Detecting changed audio hardware")
|
||||
self.sys_loop.call_later(5, self.sys_create_task, self.sys_host.sound.update())
|
||||
|
@ -99,7 +99,7 @@ class Scheduler(CoreSysAttributes):
|
||||
running: List[asyncio.tasks.Task] = []
|
||||
|
||||
# Cancel next task / get running list
|
||||
_LOGGER.info("Shutdown scheduled tasks")
|
||||
_LOGGER.info("Shutting down scheduled tasks")
|
||||
for task in self._tasks:
|
||||
if task.next:
|
||||
task.next.cancel()
|
||||
|
@ -130,6 +130,7 @@ class Tasks(CoreSysAttributes):
|
||||
|
||||
if self.sys_host.info.free_space > MINIMUM_FREE_SPACE_THRESHOLD:
|
||||
_LOGGER.warning("Not enough free space, pausing add-on updates")
|
||||
_LOGGER.info("Aviable free space is %s", self.sys_host.info.free_space)
|
||||
self.sys_resolution.issues = IssueType.FREE_SPACE
|
||||
return
|
||||
|
||||
@ -148,15 +149,19 @@ class Tasks(CoreSysAttributes):
|
||||
|
||||
# don't perform an update on dev channel
|
||||
if self.sys_dev:
|
||||
_LOGGER.warning("Ignore Supervisor update on dev channel!")
|
||||
_LOGGER.warning("Ignore Supervisor updates on dev channel!")
|
||||
return
|
||||
|
||||
if self.sys_host.info.free_space > MINIMUM_FREE_SPACE_THRESHOLD:
|
||||
_LOGGER.warning("Not enough free space, pausing supervisor update")
|
||||
_LOGGER.info("Aviable free space is %s", self.sys_host.info.free_space)
|
||||
self.sys_resolution.issues = IssueType.FREE_SPACE
|
||||
return
|
||||
|
||||
_LOGGER.info("Found new Supervisor version")
|
||||
_LOGGER.info(
|
||||
"Found new Supervisor version %s, updating",
|
||||
self.sys_supervisor.latest_version,
|
||||
)
|
||||
await self.sys_supervisor.update()
|
||||
|
||||
async def _watchdog_homeassistant_docker(self):
|
||||
@ -180,7 +185,7 @@ class Tasks(CoreSysAttributes):
|
||||
try:
|
||||
await self.sys_homeassistant.core.start()
|
||||
except HomeAssistantError as err:
|
||||
_LOGGER.error("Watchdog Home Assistant reanimation failed!")
|
||||
_LOGGER.error("Home Assistant watchdog reanimation failed!")
|
||||
self.sys_capture_exception(err)
|
||||
|
||||
async def _watchdog_homeassistant_api(self):
|
||||
@ -218,7 +223,7 @@ class Tasks(CoreSysAttributes):
|
||||
try:
|
||||
await self.sys_homeassistant.core.restart()
|
||||
except HomeAssistantError as err:
|
||||
_LOGGER.error("Watchdog Home Assistant reanimation failed!")
|
||||
_LOGGER.error("Home Assistant watchdog reanimation failed!")
|
||||
self.sys_capture_exception(err)
|
||||
finally:
|
||||
self._cache[HASS_WATCHDOG_API] = 0
|
||||
@ -228,7 +233,9 @@ class Tasks(CoreSysAttributes):
|
||||
if not self.sys_plugins.cli.need_update:
|
||||
return
|
||||
|
||||
_LOGGER.info("Found new cli version")
|
||||
_LOGGER.info(
|
||||
"Found new cli version %s, updating", self.sys_plugins.cli.latest_version
|
||||
)
|
||||
await self.sys_plugins.cli.update()
|
||||
|
||||
async def _update_dns(self):
|
||||
@ -236,7 +243,10 @@ class Tasks(CoreSysAttributes):
|
||||
if not self.sys_plugins.dns.need_update:
|
||||
return
|
||||
|
||||
_LOGGER.info("Found new CoreDNS plugin version")
|
||||
_LOGGER.info(
|
||||
"Found new CoreDNS plugin version %s, updating",
|
||||
self.sys_plugins.dns.latest_version,
|
||||
)
|
||||
await self.sys_plugins.dns.update()
|
||||
|
||||
async def _update_audio(self):
|
||||
@ -244,7 +254,10 @@ class Tasks(CoreSysAttributes):
|
||||
if not self.sys_plugins.audio.need_update:
|
||||
return
|
||||
|
||||
_LOGGER.info("Found new PulseAudio plugin version")
|
||||
_LOGGER.info(
|
||||
"Found new PulseAudio plugin version %s, updating",
|
||||
self.sys_plugins.audio.latest_version,
|
||||
)
|
||||
await self.sys_plugins.audio.update()
|
||||
|
||||
async def _update_observer(self):
|
||||
@ -252,7 +265,10 @@ class Tasks(CoreSysAttributes):
|
||||
if not self.sys_plugins.observer.need_update:
|
||||
return
|
||||
|
||||
_LOGGER.info("Found new Observer plugin version")
|
||||
_LOGGER.info(
|
||||
"Found new Observer plugin version %s, updating",
|
||||
self.sys_plugins.observer.latest_version,
|
||||
)
|
||||
await self.sys_plugins.observer.update()
|
||||
|
||||
async def _update_multicast(self):
|
||||
@ -260,7 +276,10 @@ class Tasks(CoreSysAttributes):
|
||||
if not self.sys_plugins.multicast.need_update:
|
||||
return
|
||||
|
||||
_LOGGER.info("Found new Multicast version")
|
||||
_LOGGER.info(
|
||||
"Found new Multicast version %s, updating",
|
||||
self.sys_plugins.multicast.latest_version,
|
||||
)
|
||||
await self.sys_plugins.multicast.update()
|
||||
|
||||
async def _watchdog_dns_docker(self):
|
||||
@ -272,14 +291,14 @@ class Tasks(CoreSysAttributes):
|
||||
|
||||
# Reset of failed
|
||||
if await self.sys_plugins.dns.is_failed():
|
||||
_LOGGER.error("CoreDNS plugin is in failed state / Reset config")
|
||||
_LOGGER.error("CoreDNS plugin is in failed state, resetting configuration")
|
||||
await self.sys_plugins.dns.reset()
|
||||
await self.sys_plugins.dns.loop_detection()
|
||||
|
||||
try:
|
||||
await self.sys_plugins.dns.start()
|
||||
except CoreDNSError:
|
||||
_LOGGER.error("Watchdog CoreDNS reanimation failed!")
|
||||
_LOGGER.error("CoreDNS watchdog reanimation failed!")
|
||||
|
||||
async def _watchdog_audio_docker(self):
|
||||
"""Check running state of Docker and start if they is close."""
|
||||
@ -294,7 +313,7 @@ class Tasks(CoreSysAttributes):
|
||||
try:
|
||||
await self.sys_plugins.audio.start()
|
||||
except AudioError:
|
||||
_LOGGER.error("Watchdog PulseAudio reanimation failed!")
|
||||
_LOGGER.error("PulseAudio watchdog reanimation failed!")
|
||||
|
||||
async def _watchdog_cli_docker(self):
|
||||
"""Check running state of Docker and start if they is close."""
|
||||
@ -306,7 +325,7 @@ class Tasks(CoreSysAttributes):
|
||||
try:
|
||||
await self.sys_plugins.cli.start()
|
||||
except CliError:
|
||||
_LOGGER.error("Watchdog cli reanimation failed!")
|
||||
_LOGGER.error("CLI watchdog reanimation failed!")
|
||||
|
||||
async def _watchdog_observer_docker(self):
|
||||
"""Check running state of Docker and start if they is close."""
|
||||
@ -321,7 +340,7 @@ class Tasks(CoreSysAttributes):
|
||||
try:
|
||||
await self.sys_plugins.observer.start()
|
||||
except ObserverError:
|
||||
_LOGGER.error("Watchdog observer reanimation failed!")
|
||||
_LOGGER.error("Observer watchdog reanimation failed!")
|
||||
|
||||
async def _watchdog_observer_application(self):
|
||||
"""Check running state of application and rebuild if they is not response."""
|
||||
@ -336,7 +355,7 @@ class Tasks(CoreSysAttributes):
|
||||
try:
|
||||
await self.sys_plugins.observer.rebuild()
|
||||
except ObserverError:
|
||||
_LOGGER.error("Watchdog observer reanimation failed!")
|
||||
_LOGGER.error("Observer watchdog reanimation failed!")
|
||||
|
||||
async def _watchdog_multicast_docker(self):
|
||||
"""Check running state of Docker and start if they is close."""
|
||||
@ -351,7 +370,7 @@ class Tasks(CoreSysAttributes):
|
||||
try:
|
||||
await self.sys_plugins.multicast.start()
|
||||
except MulticastError:
|
||||
_LOGGER.error("Watchdog Multicast reanimation failed!")
|
||||
_LOGGER.error("Multicast watchdog reanimation failed!")
|
||||
|
||||
async def _watchdog_addon_docker(self):
|
||||
"""Check running state of Docker and start if they is close."""
|
||||
@ -368,7 +387,7 @@ class Tasks(CoreSysAttributes):
|
||||
try:
|
||||
await addon.start()
|
||||
except AddonsError as err:
|
||||
_LOGGER.error("Watchdog %s reanimation failed with %s", addon.slug, err)
|
||||
_LOGGER.error("%s watchdog reanimation failed with %s", addon.slug, err)
|
||||
self.sys_capture_exception(err)
|
||||
|
||||
async def _watchdog_addon_application(self):
|
||||
@ -398,7 +417,7 @@ class Tasks(CoreSysAttributes):
|
||||
try:
|
||||
await addon.restart()
|
||||
except AddonsError as err:
|
||||
_LOGGER.error("Watchdog %s reanimation failed with %s", addon.slug, err)
|
||||
_LOGGER.error("%s watchdog reanimation failed with %s", addon.slug, err)
|
||||
self.sys_capture_exception(err)
|
||||
finally:
|
||||
self._cache[addon.slug] = 0
|
||||
|
@ -89,12 +89,12 @@ class PluginManager(CoreSysAttributes):
|
||||
continue
|
||||
except TypeError:
|
||||
_LOGGER.warning(
|
||||
"Somethings going wrong with requirements on %s",
|
||||
"Unexpected issue while checking requirements for %s",
|
||||
type(plugin).__name__,
|
||||
)
|
||||
|
||||
_LOGGER.info(
|
||||
"Requirement need update for %s - %s",
|
||||
"%s does not have the required version %s, updating",
|
||||
type(plugin).__name__,
|
||||
required_version,
|
||||
)
|
||||
@ -102,7 +102,7 @@ class PluginManager(CoreSysAttributes):
|
||||
await plugin.update(version=str(required_version))
|
||||
except HassioError:
|
||||
_LOGGER.error(
|
||||
"Can't update %s to %s but it's a reuirement, the Supervisor is not health now!",
|
||||
"Can't update %s to %s but it's a reuirement, the Supervisor is now in an unhealthy state!",
|
||||
type(plugin).__name__,
|
||||
required_version,
|
||||
)
|
||||
|
@ -136,7 +136,7 @@ class Audio(JsonConfig, CoreSysAttributes):
|
||||
self.latest_version, image=self.sys_updater.image_audio
|
||||
)
|
||||
break
|
||||
_LOGGER.warning("Error on install Audio plugin. Retry in 30sec")
|
||||
_LOGGER.warning("Error on installing Audio plugin, retrying in 30sec")
|
||||
await asyncio.sleep(30)
|
||||
|
||||
_LOGGER.info("Audio plugin now installed")
|
||||
@ -172,7 +172,7 @@ class Audio(JsonConfig, CoreSysAttributes):
|
||||
|
||||
async def restart(self) -> None:
|
||||
"""Restart Audio plugin."""
|
||||
_LOGGER.info("Restart Audio plugin")
|
||||
_LOGGER.info("Restarting Audio plugin")
|
||||
try:
|
||||
await self.instance.restart()
|
||||
except DockerError as err:
|
||||
@ -181,7 +181,7 @@ class Audio(JsonConfig, CoreSysAttributes):
|
||||
|
||||
async def start(self) -> None:
|
||||
"""Run CoreDNS."""
|
||||
_LOGGER.info("Start Audio plugin")
|
||||
_LOGGER.info("Starting Audio plugin")
|
||||
try:
|
||||
await self.instance.run()
|
||||
except DockerError as err:
|
||||
@ -190,7 +190,7 @@ class Audio(JsonConfig, CoreSysAttributes):
|
||||
|
||||
async def stop(self) -> None:
|
||||
"""Stop CoreDNS."""
|
||||
_LOGGER.info("Stop Audio plugin")
|
||||
_LOGGER.info("Stopping Audio plugin")
|
||||
try:
|
||||
await self.instance.stop()
|
||||
except DockerError as err:
|
||||
@ -223,11 +223,11 @@ class Audio(JsonConfig, CoreSysAttributes):
|
||||
if await self.instance.exists():
|
||||
return
|
||||
|
||||
_LOGGER.info("Repair Audio %s", self.version)
|
||||
_LOGGER.info("Repairing Audio %s", self.version)
|
||||
try:
|
||||
await self.instance.install(self.version)
|
||||
except DockerError as err:
|
||||
_LOGGER.error("Repairing of Audio failed")
|
||||
_LOGGER.error("Repair of Audio failed")
|
||||
self.sys_capture_exception(err)
|
||||
|
||||
def pulse_client(self, input_profile=None, output_profile=None) -> str:
|
||||
|
@ -98,7 +98,7 @@ class HaCli(CoreSysAttributes, JsonConfig):
|
||||
|
||||
async def install(self) -> None:
|
||||
"""Install cli."""
|
||||
_LOGGER.info("Setup cli plugin")
|
||||
_LOGGER.info("Running setup for CLI plugin")
|
||||
while True:
|
||||
# read audio tag and install it
|
||||
if not self.latest_version:
|
||||
@ -114,7 +114,7 @@ class HaCli(CoreSysAttributes, JsonConfig):
|
||||
_LOGGER.warning("Error on install cli plugin. Retry in 30sec")
|
||||
await asyncio.sleep(30)
|
||||
|
||||
_LOGGER.info("cli plugin now installed")
|
||||
_LOGGER.info("CLI plugin is now installed")
|
||||
self.version = self.instance.version
|
||||
self.image = self.sys_updater.image_cli
|
||||
self.save_data()
|
||||
@ -125,13 +125,13 @@ class HaCli(CoreSysAttributes, JsonConfig):
|
||||
old_image = self.image
|
||||
|
||||
if version == self.version:
|
||||
_LOGGER.warning("Version %s is already installed for cli", version)
|
||||
_LOGGER.warning("Version %s is already installed for CLI", version)
|
||||
return
|
||||
|
||||
try:
|
||||
await self.instance.update(version, image=self.sys_updater.image_cli)
|
||||
except DockerError as err:
|
||||
_LOGGER.error("HA cli update failed")
|
||||
_LOGGER.error("CLI update failed")
|
||||
raise CliUpdateError() from err
|
||||
else:
|
||||
self.version = version
|
||||
@ -152,7 +152,7 @@ class HaCli(CoreSysAttributes, JsonConfig):
|
||||
self.save_data()
|
||||
|
||||
# Start Instance
|
||||
_LOGGER.info("Start cli plugin")
|
||||
_LOGGER.info("Starting CLI plugin")
|
||||
try:
|
||||
await self.instance.run()
|
||||
except DockerError as err:
|
||||
@ -161,7 +161,7 @@ class HaCli(CoreSysAttributes, JsonConfig):
|
||||
|
||||
async def stop(self) -> None:
|
||||
"""Stop cli."""
|
||||
_LOGGER.info("Stop cli plugin")
|
||||
_LOGGER.info("Stopping cli plugin")
|
||||
try:
|
||||
await self.instance.stop()
|
||||
except DockerError as err:
|
||||
@ -187,9 +187,9 @@ class HaCli(CoreSysAttributes, JsonConfig):
|
||||
if await self.instance.exists():
|
||||
return
|
||||
|
||||
_LOGGER.info("Repair HA cli %s", self.version)
|
||||
_LOGGER.info("Repairing HA cli %s", self.version)
|
||||
try:
|
||||
await self.instance.install(self.version)
|
||||
except DockerError as err:
|
||||
_LOGGER.error("Repairing of HA cli failed")
|
||||
_LOGGER.error("Repair of HA cli failed")
|
||||
self.sys_capture_exception(err)
|
||||
|
@ -155,7 +155,7 @@ class CoreDNS(JsonConfig, CoreSysAttributes):
|
||||
|
||||
async def install(self) -> None:
|
||||
"""Install CoreDNS."""
|
||||
_LOGGER.info("Setup CoreDNS plugin")
|
||||
_LOGGER.info("Running setup for CoreDNS plugin")
|
||||
while True:
|
||||
# read homeassistant tag and install it
|
||||
if not self.latest_version:
|
||||
@ -208,7 +208,7 @@ class CoreDNS(JsonConfig, CoreSysAttributes):
|
||||
async def restart(self) -> None:
|
||||
"""Restart CoreDNS plugin."""
|
||||
self._write_corefile()
|
||||
_LOGGER.info("Restart CoreDNS plugin")
|
||||
_LOGGER.info("Restarting CoreDNS plugin")
|
||||
try:
|
||||
await self.instance.restart()
|
||||
except DockerError as err:
|
||||
@ -220,7 +220,7 @@ class CoreDNS(JsonConfig, CoreSysAttributes):
|
||||
self._write_corefile()
|
||||
|
||||
# Start Instance
|
||||
_LOGGER.info("Start CoreDNS plugin")
|
||||
_LOGGER.info("Starting CoreDNS plugin")
|
||||
try:
|
||||
await self.instance.run()
|
||||
except DockerError as err:
|
||||
@ -229,7 +229,7 @@ class CoreDNS(JsonConfig, CoreSysAttributes):
|
||||
|
||||
async def stop(self) -> None:
|
||||
"""Stop CoreDNS."""
|
||||
_LOGGER.info("Stop CoreDNS plugin")
|
||||
_LOGGER.info("Stopping CoreDNS plugin")
|
||||
try:
|
||||
await self.instance.stop()
|
||||
except DockerError as err:
|
||||
@ -258,7 +258,7 @@ class CoreDNS(JsonConfig, CoreSysAttributes):
|
||||
|
||||
# Check the log for loop plugin output
|
||||
if b"plugin/loop: Loop" in log:
|
||||
_LOGGER.error("Detect a DNS loop in local Network!")
|
||||
_LOGGER.error("Detected a DNS loop in local Network!")
|
||||
self._loop = True
|
||||
else:
|
||||
self._loop = False
|
||||
@ -274,7 +274,7 @@ class CoreDNS(JsonConfig, CoreSysAttributes):
|
||||
local_dns = self.sys_host.network.dns_servers or ["dns://127.0.0.11"]
|
||||
servers = self.servers + local_dns
|
||||
else:
|
||||
_LOGGER.warning("Ignore user DNS settings because of loop")
|
||||
_LOGGER.warning("Ignoring user DNS settings because of loop")
|
||||
|
||||
# Print some usefully debug data
|
||||
_LOGGER.debug(
|
||||
@ -290,7 +290,7 @@ class CoreDNS(JsonConfig, CoreSysAttributes):
|
||||
if server not in dns_servers:
|
||||
dns_servers.append(server)
|
||||
except vol.Invalid:
|
||||
_LOGGER.warning("Ignore invalid DNS Server: %s", server)
|
||||
_LOGGER.warning("Ignoring invalid DNS Server: %s", server)
|
||||
|
||||
# Generate config file
|
||||
data = self.coredns_template.render(
|
||||
@ -362,7 +362,7 @@ class CoreDNS(JsonConfig, CoreSysAttributes):
|
||||
_LOGGER.debug("Can't remove Host entry: %s", host)
|
||||
return
|
||||
|
||||
_LOGGER.debug("Remove Host entry %s - %s", entry.ip_address, entry.names)
|
||||
_LOGGER.debug("Removeing host entry %s - %s", entry.ip_address, entry.names)
|
||||
self._hosts.remove(entry)
|
||||
|
||||
# Update hosts file
|
||||
@ -411,11 +411,11 @@ class CoreDNS(JsonConfig, CoreSysAttributes):
|
||||
if await self.instance.exists():
|
||||
return
|
||||
|
||||
_LOGGER.info("Repair CoreDNS %s", self.version)
|
||||
_LOGGER.info("Repairing CoreDNS %s", self.version)
|
||||
try:
|
||||
await self.instance.install(self.version)
|
||||
except DockerError as err:
|
||||
_LOGGER.error("Repairing of CoreDNS failed")
|
||||
_LOGGER.error("Repair of CoreDNS failed")
|
||||
self.sys_capture_exception(err)
|
||||
|
||||
def _write_resolv(self, resolv_conf: Path) -> None:
|
||||
|
@ -96,7 +96,7 @@ class Multicast(JsonConfig, CoreSysAttributes):
|
||||
|
||||
async def install(self) -> None:
|
||||
"""Install Multicast."""
|
||||
_LOGGER.info("Setup Multicast plugin")
|
||||
_LOGGER.info("Running setup for Multicast plugin")
|
||||
while True:
|
||||
# read homeassistant tag and install it
|
||||
if not self.latest_version:
|
||||
@ -111,7 +111,7 @@ class Multicast(JsonConfig, CoreSysAttributes):
|
||||
_LOGGER.warning("Error on install Multicast plugin. Retry in 30sec")
|
||||
await asyncio.sleep(30)
|
||||
|
||||
_LOGGER.info("Multicast plugin now installed")
|
||||
_LOGGER.info("Multicast plugin is now installed")
|
||||
self.version = self.instance.version
|
||||
self.image = self.sys_updater.image_multicast
|
||||
self.save_data()
|
||||
@ -145,7 +145,7 @@ class Multicast(JsonConfig, CoreSysAttributes):
|
||||
|
||||
async def restart(self) -> None:
|
||||
"""Restart Multicast plugin."""
|
||||
_LOGGER.info("Restart Multicast plugin")
|
||||
_LOGGER.info("Restarting Multicast plugin")
|
||||
try:
|
||||
await self.instance.restart()
|
||||
except DockerError as err:
|
||||
@ -154,7 +154,7 @@ class Multicast(JsonConfig, CoreSysAttributes):
|
||||
|
||||
async def start(self) -> None:
|
||||
"""Run Multicast."""
|
||||
_LOGGER.info("Start Multicast plugin")
|
||||
_LOGGER.info("Starting Multicast plugin")
|
||||
try:
|
||||
await self.instance.run()
|
||||
except DockerError as err:
|
||||
@ -163,7 +163,7 @@ class Multicast(JsonConfig, CoreSysAttributes):
|
||||
|
||||
async def stop(self) -> None:
|
||||
"""Stop Multicast."""
|
||||
_LOGGER.info("Stop Multicast plugin")
|
||||
_LOGGER.info("Stopping Multicast plugin")
|
||||
try:
|
||||
await self.instance.stop()
|
||||
except DockerError as err:
|
||||
@ -203,9 +203,9 @@ class Multicast(JsonConfig, CoreSysAttributes):
|
||||
if await self.instance.exists():
|
||||
return
|
||||
|
||||
_LOGGER.info("Repair Multicast %s", self.version)
|
||||
_LOGGER.info("Repairing Multicast %s", self.version)
|
||||
try:
|
||||
await self.instance.install(self.version)
|
||||
except DockerError as err:
|
||||
_LOGGER.error("Repairing of Multicast failed")
|
||||
_LOGGER.error("Repair of Multicast failed")
|
||||
self.sys_capture_exception(err)
|
||||
|
@ -102,7 +102,7 @@ class Observer(CoreSysAttributes, JsonConfig):
|
||||
|
||||
async def install(self) -> None:
|
||||
"""Install observer."""
|
||||
_LOGGER.info("Setup observer plugin")
|
||||
_LOGGER.info("Running setup for observer plugin")
|
||||
while True:
|
||||
# read observer tag and install it
|
||||
if not self.latest_version:
|
||||
@ -156,7 +156,7 @@ class Observer(CoreSysAttributes, JsonConfig):
|
||||
self.save_data()
|
||||
|
||||
# Start Instance
|
||||
_LOGGER.info("Start observer plugin")
|
||||
_LOGGER.info("Starting observer plugin")
|
||||
try:
|
||||
await self.instance.run()
|
||||
except DockerError as err:
|
||||
@ -202,9 +202,9 @@ class Observer(CoreSysAttributes, JsonConfig):
|
||||
if await self.instance.exists():
|
||||
return
|
||||
|
||||
_LOGGER.info("Repair HA observer %s", self.version)
|
||||
_LOGGER.info("Repairing HA observer %s", self.version)
|
||||
try:
|
||||
await self.instance.install(self.version)
|
||||
except DockerError as err:
|
||||
_LOGGER.error("Repairing of HA observer failed")
|
||||
_LOGGER.error("Repair of HA observer failed")
|
||||
self.sys_capture_exception(err)
|
||||
|
@ -70,7 +70,9 @@ class MQTTService(ServiceInterface):
|
||||
def set_service_data(self, addon: Addon, data: Dict[str, Any]) -> None:
|
||||
"""Write the data into service object."""
|
||||
if self.enabled:
|
||||
_LOGGER.error("It is already a MQTT in use from %s", self._data[ATTR_ADDON])
|
||||
_LOGGER.error(
|
||||
"There is already a MQTT service in use from %s", self._data[ATTR_ADDON]
|
||||
)
|
||||
raise ServicesError()
|
||||
|
||||
self._data.update(data)
|
||||
|
@ -65,7 +65,8 @@ class MySQLService(ServiceInterface):
|
||||
"""Write the data into service object."""
|
||||
if self.enabled:
|
||||
_LOGGER.error(
|
||||
"There is already a MySQL in use from %s", self._data[ATTR_ADDON]
|
||||
"There is already a MySQL service in use from %s",
|
||||
self._data[ATTR_ADDON],
|
||||
)
|
||||
raise ServicesError()
|
||||
|
||||
|
@ -114,7 +114,7 @@ class SnapshotManager(CoreSysAttributes):
|
||||
snapshot = Snapshot(self.coresys, tar_origin)
|
||||
if not await snapshot.load():
|
||||
return None
|
||||
_LOGGER.info("Success import %s", snapshot.slug)
|
||||
_LOGGER.info("Successfully imported %s", snapshot.slug)
|
||||
|
||||
self.snapshots_obj[snapshot.slug] = snapshot
|
||||
return snapshot
|
||||
@ -126,18 +126,18 @@ class SnapshotManager(CoreSysAttributes):
|
||||
return None
|
||||
|
||||
snapshot = self._create_snapshot(name, SNAPSHOT_FULL, password)
|
||||
_LOGGER.info("Full-Snapshot %s start", snapshot.slug)
|
||||
_LOGGER.info("Creating new full-snapshot with slug %s", snapshot.slug)
|
||||
try:
|
||||
self.sys_core.state = CoreState.FREEZE
|
||||
await self.lock.acquire()
|
||||
|
||||
async with snapshot:
|
||||
# Snapshot add-ons
|
||||
_LOGGER.info("Snapshot %s store Add-ons", snapshot.slug)
|
||||
_LOGGER.info("Snapshotting %s store Add-ons", snapshot.slug)
|
||||
await snapshot.store_addons()
|
||||
|
||||
# Snapshot folders
|
||||
_LOGGER.info("Snapshot %s store folders", snapshot.slug)
|
||||
_LOGGER.info("Snapshotting %s store folders", snapshot.slug)
|
||||
await snapshot.store_folders()
|
||||
|
||||
except Exception as excep: # pylint: disable=broad-except
|
||||
@ -146,7 +146,7 @@ class SnapshotManager(CoreSysAttributes):
|
||||
return None
|
||||
|
||||
else:
|
||||
_LOGGER.info("Full-Snapshot %s done", snapshot.slug)
|
||||
_LOGGER.info("Crating full-snapshot with slug %s completed", snapshot.slug)
|
||||
self.snapshots_obj[snapshot.slug] = snapshot
|
||||
return snapshot
|
||||
|
||||
@ -166,7 +166,7 @@ class SnapshotManager(CoreSysAttributes):
|
||||
folders = folders or []
|
||||
snapshot = self._create_snapshot(name, SNAPSHOT_PARTIAL, password)
|
||||
|
||||
_LOGGER.info("Partial-Snapshot %s start", snapshot.slug)
|
||||
_LOGGER.info("Creating new partial-snapshot with slug %s", snapshot.slug)
|
||||
try:
|
||||
self.sys_core.state = CoreState.FREEZE
|
||||
await self.lock.acquire()
|
||||
@ -182,12 +182,12 @@ class SnapshotManager(CoreSysAttributes):
|
||||
_LOGGER.warning("Add-on %s not found/installed", addon_slug)
|
||||
|
||||
if addon_list:
|
||||
_LOGGER.info("Snapshot %s store Add-ons", snapshot.slug)
|
||||
_LOGGER.info("Snapshotting %s store Add-ons", snapshot.slug)
|
||||
await snapshot.store_addons(addon_list)
|
||||
|
||||
# Snapshot folders
|
||||
if folders:
|
||||
_LOGGER.info("Snapshot %s store folders", snapshot.slug)
|
||||
_LOGGER.info("Snapshotting %s store folders", snapshot.slug)
|
||||
await snapshot.store_folders(folders)
|
||||
|
||||
except Exception: # pylint: disable=broad-except
|
||||
@ -195,7 +195,9 @@ class SnapshotManager(CoreSysAttributes):
|
||||
return None
|
||||
|
||||
else:
|
||||
_LOGGER.info("Partial-Snapshot %s done", snapshot.slug)
|
||||
_LOGGER.info(
|
||||
"Crating partial-snapshot with slug %s completed", snapshot.slug
|
||||
)
|
||||
self.snapshots_obj[snapshot.slug] = snapshot
|
||||
return snapshot
|
||||
|
||||
@ -210,7 +212,7 @@ class SnapshotManager(CoreSysAttributes):
|
||||
return False
|
||||
|
||||
if snapshot.sys_type != SNAPSHOT_FULL:
|
||||
_LOGGER.error("Restore %s is only a partial snapshot!", snapshot.slug)
|
||||
_LOGGER.error("%s is only a partial snapshot!", snapshot.slug)
|
||||
return False
|
||||
|
||||
if snapshot.protected and not snapshot.set_password(password):
|
||||
@ -227,26 +229,26 @@ class SnapshotManager(CoreSysAttributes):
|
||||
await self.sys_core.shutdown()
|
||||
|
||||
# Restore folders
|
||||
_LOGGER.info("Restore %s run folders", snapshot.slug)
|
||||
_LOGGER.info("Restoring %s folders", snapshot.slug)
|
||||
await snapshot.restore_folders()
|
||||
|
||||
# Restore docker config
|
||||
_LOGGER.info("Restore %s run Docker Config", snapshot.slug)
|
||||
_LOGGER.info("Restoring %s Docker Config", snapshot.slug)
|
||||
snapshot.restore_dockerconfig()
|
||||
|
||||
# Start homeassistant restore
|
||||
_LOGGER.info("Restore %s run Home-Assistant", snapshot.slug)
|
||||
_LOGGER.info("Restoring %s Home-Assistant", snapshot.slug)
|
||||
snapshot.restore_homeassistant()
|
||||
task_hass = self.sys_create_task(
|
||||
self.sys_homeassistant.core.update(snapshot.homeassistant_version)
|
||||
)
|
||||
|
||||
# Restore repositories
|
||||
_LOGGER.info("Restore %s run Repositories", snapshot.slug)
|
||||
_LOGGER.info("Restoring %s Repositories", snapshot.slug)
|
||||
await snapshot.restore_repositories()
|
||||
|
||||
# Delete delta add-ons
|
||||
_LOGGER.info("Restore %s remove add-ons", snapshot.slug)
|
||||
_LOGGER.info("Removing add-ons not in the snapshot %s", snapshot.slug)
|
||||
for addon in self.sys_addons.installed:
|
||||
if addon.slug in snapshot.addon_list:
|
||||
continue
|
||||
@ -301,7 +303,7 @@ class SnapshotManager(CoreSysAttributes):
|
||||
|
||||
async with snapshot:
|
||||
# Restore docker config
|
||||
_LOGGER.info("Restore %s run Docker Config", snapshot.slug)
|
||||
_LOGGER.info("Restoring %s Docker Config", snapshot.slug)
|
||||
snapshot.restore_dockerconfig()
|
||||
|
||||
# Stop Home-Assistant for config restore
|
||||
@ -311,13 +313,13 @@ class SnapshotManager(CoreSysAttributes):
|
||||
|
||||
# Process folders
|
||||
if folders:
|
||||
_LOGGER.info("Restore %s run folders", snapshot.slug)
|
||||
_LOGGER.info("Restoring %s folders", snapshot.slug)
|
||||
await snapshot.restore_folders(folders)
|
||||
|
||||
# Process Home-Assistant
|
||||
task_hass = None
|
||||
if homeassistant:
|
||||
_LOGGER.info("Restore %s run Home-Assistant", snapshot.slug)
|
||||
_LOGGER.info("Restoring %s Home-Assistant", snapshot.slug)
|
||||
task_hass = self.sys_create_task(
|
||||
self.sys_homeassistant.core.update(
|
||||
snapshot.homeassistant_version
|
||||
@ -325,10 +327,10 @@ class SnapshotManager(CoreSysAttributes):
|
||||
)
|
||||
|
||||
if addons:
|
||||
_LOGGER.info("Restore %s run Repositories", snapshot.slug)
|
||||
_LOGGER.info("Restoring %s Repositories", snapshot.slug)
|
||||
await snapshot.restore_repositories()
|
||||
|
||||
_LOGGER.info("Restore %s old add-ons", snapshot.slug)
|
||||
_LOGGER.info("Restoring %s old add-ons", snapshot.slug)
|
||||
await snapshot.restore_addons(addons)
|
||||
|
||||
# Make sure homeassistant run agen
|
||||
|
@ -225,7 +225,7 @@ class Snapshot(CoreSysAttributes):
|
||||
async def load(self):
|
||||
"""Read snapshot.json from tar file."""
|
||||
if not self.tarfile.is_file():
|
||||
_LOGGER.error("No tarfile %s", self.tarfile)
|
||||
_LOGGER.error("No tarfile located at %s", self.tarfile)
|
||||
return False
|
||||
|
||||
def _load_file():
|
||||
@ -321,7 +321,7 @@ class Snapshot(CoreSysAttributes):
|
||||
try:
|
||||
await addon.snapshot(addon_file)
|
||||
except AddonsError:
|
||||
_LOGGER.error("Can't make snapshot from %s", addon.slug)
|
||||
_LOGGER.error("Can't create snapshot for %s", addon.slug)
|
||||
return
|
||||
|
||||
# Store to config
|
||||
@ -354,14 +354,14 @@ class Snapshot(CoreSysAttributes):
|
||||
|
||||
# If exists inside snapshot
|
||||
if not addon_file.path.exists():
|
||||
_LOGGER.error("Can't find snapshot for %s", addon_slug)
|
||||
_LOGGER.error("Can't find snapshot %s", addon_slug)
|
||||
return
|
||||
|
||||
# Perform a restore
|
||||
try:
|
||||
await self.sys_addons.restore(addon_slug, addon_file)
|
||||
except AddonsError:
|
||||
_LOGGER.error("Can't restore snapshot for %s", addon_slug)
|
||||
_LOGGER.error("Can't restore snapshot %s", addon_slug)
|
||||
|
||||
# Save Add-ons sequential
|
||||
# avoid issue on slow IO
|
||||
|
@ -65,7 +65,7 @@ class StoreManager(CoreSysAttributes):
|
||||
"""Add a repository."""
|
||||
repository = Repository(self.coresys, url)
|
||||
if not await repository.load():
|
||||
_LOGGER.error("Can't load from repository %s", url)
|
||||
_LOGGER.error("Can't load data from repository %s", url)
|
||||
return
|
||||
|
||||
# don't add built-in repository to config
|
||||
@ -107,7 +107,7 @@ class StoreManager(CoreSysAttributes):
|
||||
del_addons = set(self.sys_addons.store) - all_addons
|
||||
|
||||
_LOGGER.info(
|
||||
"Load add-ons from store: %d all - %d new - %d remove",
|
||||
"Loading add-ons from store: %d all - %d new - %d remove",
|
||||
len(all_addons),
|
||||
len(add_addons),
|
||||
len(del_addons),
|
||||
|
@ -44,7 +44,7 @@ class GitRepo(CoreSysAttributes):
|
||||
|
||||
async with self.lock:
|
||||
try:
|
||||
_LOGGER.info("Load add-on %s repository", self.path)
|
||||
_LOGGER.info("Loading add-on %s repository", self.path)
|
||||
self.repo = await self.sys_run_in_executor(git.Repo, str(self.path))
|
||||
|
||||
except (
|
||||
@ -73,7 +73,7 @@ class GitRepo(CoreSysAttributes):
|
||||
}
|
||||
|
||||
try:
|
||||
_LOGGER.info("Clone add-on %s repository", self.url)
|
||||
_LOGGER.info("Cloneing add-on %s repository", self.url)
|
||||
self.repo = await self.sys_run_in_executor(
|
||||
ft.partial(
|
||||
git.Repo.clone_from, self.url, str(self.path), **git_args
|
||||
@ -165,5 +165,5 @@ class GitRepoCustom(GitRepo):
|
||||
|
||||
async def remove(self):
|
||||
"""Remove a custom repository."""
|
||||
_LOGGER.info("Remove custom add-on repository %s", self.url)
|
||||
_LOGGER.info("Removing custom add-on repository %s", self.url)
|
||||
await self._remove()
|
||||
|
@ -75,7 +75,7 @@ class Supervisor(CoreSysAttributes):
|
||||
"""Fetch last version and update profile."""
|
||||
url = URL_HASSIO_APPARMOR
|
||||
try:
|
||||
_LOGGER.info("Fetch AppArmor profile %s", url)
|
||||
_LOGGER.info("Fetching AppArmor profile %s", url)
|
||||
async with self.sys_websession.get(url, timeout=10) as request:
|
||||
data = await request.text()
|
||||
|
||||
@ -150,8 +150,8 @@ class Supervisor(CoreSysAttributes):
|
||||
if await self.instance.exists():
|
||||
return
|
||||
|
||||
_LOGGER.info("Repair Supervisor %s", self.version)
|
||||
_LOGGER.info("Repairing Supervisor %s", self.version)
|
||||
try:
|
||||
await self.instance.retag()
|
||||
except DockerError:
|
||||
_LOGGER.error("Repairing of Supervisor failed")
|
||||
_LOGGER.error("Repair of Supervisor failed")
|
||||
|
@ -167,7 +167,7 @@ class Updater(JsonConfig, CoreSysAttributes):
|
||||
machine = self.sys_machine or "default"
|
||||
|
||||
try:
|
||||
_LOGGER.info("Fetch update data from %s", url)
|
||||
_LOGGER.info("Fetching update data from %s", url)
|
||||
async with self.sys_websession.get(url, timeout=10) as request:
|
||||
data = await request.json(content_type=None)
|
||||
|
||||
|
@ -96,7 +96,7 @@ class DBus:
|
||||
# pylint: disable=protected-access
|
||||
await self._init_proxy()
|
||||
|
||||
_LOGGER.debug("Connect to dbus: %s - %s", bus_name, object_path)
|
||||
_LOGGER.debug("Connect to D-Bus: %s - %s", bus_name, object_path)
|
||||
return self
|
||||
|
||||
async def _init_proxy(self) -> None:
|
||||
@ -222,7 +222,7 @@ class DBus:
|
||||
async def _send(self, command: List[str], silent=False) -> str:
|
||||
"""Send command over dbus."""
|
||||
# Run command
|
||||
_LOGGER.debug("Send dbus command: %s", command)
|
||||
_LOGGER.debug("Send D-Bus command: %s", command)
|
||||
try:
|
||||
proc = await asyncio.create_subprocess_exec(
|
||||
*command,
|
||||
@ -233,7 +233,7 @@ class DBus:
|
||||
|
||||
data, error = await proc.communicate()
|
||||
except OSError as err:
|
||||
_LOGGER.error("DBus fatal error: %s", err)
|
||||
_LOGGER.critical("D-Bus fatal error: %s", err)
|
||||
raise DBusFatalError() from err
|
||||
|
||||
# Success?
|
||||
@ -248,7 +248,7 @@ class DBus:
|
||||
raise exception()
|
||||
|
||||
# General
|
||||
_LOGGER.error("DBus return: %s", error.strip())
|
||||
_LOGGER.error("D-Bus return: %s", error.strip())
|
||||
raise DBusFatalError()
|
||||
|
||||
def attach_signals(self, filters=None):
|
||||
@ -277,7 +277,7 @@ class DBusCallWrapper:
|
||||
|
||||
def __call__(self) -> None:
|
||||
"""Catch this method from being called."""
|
||||
_LOGGER.error("DBus method %s not exists!", self.interface)
|
||||
_LOGGER.error("D-Bus method %s not exists!", self.interface)
|
||||
raise DBusFatalError()
|
||||
|
||||
def __getattr__(self, name: str):
|
||||
@ -308,7 +308,7 @@ class DBusSignalWrapper:
|
||||
|
||||
async def __aenter__(self):
|
||||
"""Start monitor events."""
|
||||
_LOGGER.info("Start dbus monitor on %s", self.dbus.bus_name)
|
||||
_LOGGER.info("Starting dbus monitor on %s", self.dbus.bus_name)
|
||||
command = shlex.split(MONITOR.format(bus=self.dbus.bus_name))
|
||||
self._proc = await asyncio.create_subprocess_exec(
|
||||
*command,
|
||||
@ -321,7 +321,7 @@ class DBusSignalWrapper:
|
||||
|
||||
async def __aexit__(self, exception_type, exception_value, traceback):
|
||||
"""Stop monitor events."""
|
||||
_LOGGER.info("Stop dbus monitor on %s", self.dbus.bus_name)
|
||||
_LOGGER.info("Stopping dbus monitor on %s", self.dbus.bus_name)
|
||||
self._proc.send_signal(SIGINT)
|
||||
await self._proc.communicate()
|
||||
|
||||
@ -354,7 +354,7 @@ class DBusSignalWrapper:
|
||||
|
||||
# Filter signals?
|
||||
if self._signals and signal not in self._signals:
|
||||
_LOGGER.debug("Skip event %s - %s", signal, data)
|
||||
_LOGGER.debug("Skiping event %s - %s", signal, data)
|
||||
continue
|
||||
|
||||
try:
|
||||
|
@ -70,7 +70,7 @@ class JsonConfig:
|
||||
)
|
||||
|
||||
# Reset data to default
|
||||
_LOGGER.warning("Reset %s to default", self._file)
|
||||
_LOGGER.warning("Resetting %s to default", self._file)
|
||||
self._data = self._schema(_DEFAULT)
|
||||
|
||||
def save_data(self) -> None:
|
||||
@ -82,7 +82,7 @@ class JsonConfig:
|
||||
_LOGGER.error("Can't parse data: %s", humanize_error(self._data, ex))
|
||||
|
||||
# Load last valid data
|
||||
_LOGGER.warning("Reset %s to last version", self._file)
|
||||
_LOGGER.warning("Resetting %s to last version", self._file)
|
||||
self._data = _DEFAULT
|
||||
self.read_data()
|
||||
else:
|
||||
|
@ -18,7 +18,7 @@ def format_message(message: str) -> str:
|
||||
if match:
|
||||
return f"Port '{match.group(1)}' is already in use by something else on the host."
|
||||
except TypeError as err:
|
||||
_LOGGER.error("Type of message is not string - %s", err)
|
||||
_LOGGER.error("The type of message is not a string - %s", err)
|
||||
sentry_sdk.capture_exception(err)
|
||||
|
||||
return message
|
||||
|
@ -136,7 +136,7 @@ def secure_path(tar: tarfile.TarFile) -> Generator[tarfile.TarInfo, None, None]:
|
||||
raise ValueError()
|
||||
Path("/fake", file_path).resolve().relative_to("/fake")
|
||||
except (ValueError, RuntimeError):
|
||||
_LOGGER.warning("Issue with file %s", file_path)
|
||||
_LOGGER.warning("Found issue with file %s", file_path)
|
||||
continue
|
||||
else:
|
||||
yield member
|
||||
@ -148,7 +148,7 @@ def _is_excluded_by_filter(path: PurePath, exclude_list: List[str]) -> bool:
|
||||
for exclude in exclude_list:
|
||||
if not path.match(exclude):
|
||||
continue
|
||||
_LOGGER.debug("Ignore %s because of %s", path, exclude)
|
||||
_LOGGER.debug("Ignoring %s because of %s", path, exclude)
|
||||
return True
|
||||
|
||||
return False
|
||||
|
Loading…
x
Reference in New Issue
Block a user