Rename Hass.io -> Supervisor (#1522)
* Rename Hass.io -> Supervisor * part 2 * fix lint * fix auth name
This commit is contained in:
parent
e9f5b13aa5
commit
4ac7f7dcf0
|
@ -1,31 +1,24 @@
|
|||
// See https://aka.ms/vscode-remote/devcontainer.json for format details.
|
||||
{
|
||||
"name": "Hass.io dev",
|
||||
"context": "..",
|
||||
"dockerFile": "Dockerfile",
|
||||
"appPort": "9123:8123",
|
||||
"runArgs": [
|
||||
"-e",
|
||||
"GIT_EDITOR=code --wait",
|
||||
"--privileged"
|
||||
],
|
||||
"extensions": [
|
||||
"ms-python.python",
|
||||
"visualstudioexptteam.vscodeintellicode",
|
||||
"esbenp.prettier-vscode"
|
||||
],
|
||||
"settings": {
|
||||
"python.pythonPath": "/usr/local/bin/python",
|
||||
"python.linting.pylintEnabled": true,
|
||||
"python.linting.enabled": true,
|
||||
"python.formatting.provider": "black",
|
||||
"python.formatting.blackArgs": [
|
||||
"--target-version",
|
||||
"py37"
|
||||
],
|
||||
"editor.formatOnPaste": false,
|
||||
"editor.formatOnSave": true,
|
||||
"editor.formatOnType": true,
|
||||
"files.trimTrailingWhitespace": true
|
||||
}
|
||||
}
|
||||
"name": "Supervisor dev",
|
||||
"context": "..",
|
||||
"dockerFile": "Dockerfile",
|
||||
"appPort": "9123:8123",
|
||||
"runArgs": ["-e", "GIT_EDITOR=code --wait", "--privileged"],
|
||||
"extensions": [
|
||||
"ms-python.python",
|
||||
"visualstudioexptteam.vscodeintellicode",
|
||||
"esbenp.prettier-vscode"
|
||||
],
|
||||
"settings": {
|
||||
"python.pythonPath": "/usr/local/bin/python",
|
||||
"python.linting.pylintEnabled": true,
|
||||
"python.linting.enabled": true,
|
||||
"python.formatting.provider": "black",
|
||||
"python.formatting.blackArgs": ["--target-version", "py37"],
|
||||
"editor.formatOnPaste": false,
|
||||
"editor.formatOnSave": true,
|
||||
"editor.formatOnType": true,
|
||||
"files.trimTrailingWhitespace": true
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,4 +34,4 @@ COPY entry.sh /bin/
|
|||
ENTRYPOINT ["/bin/entry.sh"]
|
||||
|
||||
WORKDIR /
|
||||
CMD [ "python3", "-m", "hassio" ]
|
||||
CMD [ "python3", "-m", "supervisor" ]
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[![Build Status](https://dev.azure.com/home-assistant/Hass.io/_apis/build/status/hassio?branchName=dev)](https://dev.azure.com/home-assistant/Hass.io/_build/latest?definitionId=2&branchName=dev)
|
||||
|
||||
# Hass.io
|
||||
# Home Assistant Supervisor
|
||||
|
||||
## First private cloud solution for home automation
|
||||
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
"""Init file for Hass.io."""
|
|
@ -1 +0,0 @@
|
|||
"""Special object and tools for Hass.io."""
|
|
@ -14,5 +14,5 @@ cd hassio
|
|||
./script/build_hassio
|
||||
|
||||
# Copy frontend
|
||||
rm -f ../../hassio/api/panel/chunk.*
|
||||
cp -rf build/* ../../hassio/api/panel/
|
||||
rm -f ../../supervisor/hassio/api/panel/chunk.*
|
||||
cp -rf build/* ../../supervisor/api/panel/
|
22
setup.py
22
setup.py
|
@ -1,10 +1,10 @@
|
|||
from setuptools import setup
|
||||
|
||||
from hassio.const import HASSIO_VERSION
|
||||
from supervisor.const import SUPERVISOR_VERSION
|
||||
|
||||
setup(
|
||||
name="HassIO",
|
||||
version=HASSIO_VERSION,
|
||||
name="Supervisor",
|
||||
version=SUPERVISOR_VERSION,
|
||||
license="BSD License",
|
||||
author="The Home Assistant Authors",
|
||||
author_email="hello@home-assistant.io",
|
||||
|
@ -24,19 +24,19 @@ setup(
|
|||
"Topic :: Scientific/Engineering :: Atmospheric Science",
|
||||
"Development Status :: 5 - Production/Stable",
|
||||
"Intended Audience :: Developers",
|
||||
"Programming Language :: Python :: 3.6",
|
||||
"Programming Language :: Python :: 3.7",
|
||||
],
|
||||
keywords=["docker", "home-assistant", "api"],
|
||||
zip_safe=False,
|
||||
platforms="any",
|
||||
packages=[
|
||||
"hassio",
|
||||
"hassio.docker",
|
||||
"hassio.addons",
|
||||
"hassio.api",
|
||||
"hassio.misc",
|
||||
"hassio.utils",
|
||||
"hassio.snapshots",
|
||||
"supervisor",
|
||||
"supervisor.docker",
|
||||
"supervisor.addons",
|
||||
"supervisor.api",
|
||||
"supervisor.misc",
|
||||
"supervisor.utils",
|
||||
"supervisor.snapshots",
|
||||
],
|
||||
include_package_data=True,
|
||||
)
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
"""Init file for Supervisor."""
|
|
@ -1,10 +1,10 @@
|
|||
"""Main file for Hass.io."""
|
||||
"""Main file for Supervisor."""
|
||||
import asyncio
|
||||
from concurrent.futures import ThreadPoolExecutor
|
||||
import logging
|
||||
import sys
|
||||
|
||||
from hassio import bootstrap
|
||||
from supervisor import bootstrap
|
||||
|
||||
_LOGGER: logging.Logger = logging.getLogger(__name__)
|
||||
|
||||
|
@ -29,7 +29,7 @@ if __name__ == "__main__":
|
|||
# Init async event loop
|
||||
loop = initialize_event_loop()
|
||||
|
||||
# Check if all information are available to setup Hass.io
|
||||
# Check if all information are available to setup Supervisor
|
||||
if not bootstrap.check_environment():
|
||||
sys.exit(1)
|
||||
|
||||
|
@ -37,27 +37,27 @@ if __name__ == "__main__":
|
|||
executor = ThreadPoolExecutor(thread_name_prefix="SyncWorker")
|
||||
loop.set_default_executor(executor)
|
||||
|
||||
_LOGGER.info("Initialize Hass.io setup")
|
||||
_LOGGER.info("Initialize 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 HassIO")
|
||||
_LOGGER.info("Setup 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)
|
||||
|
||||
try:
|
||||
_LOGGER.info("Run Hass.io")
|
||||
_LOGGER.info("Run Supervisor")
|
||||
loop.run_forever()
|
||||
finally:
|
||||
_LOGGER.info("Stopping Hass.io")
|
||||
_LOGGER.info("Stopping Supervisor")
|
||||
loop.run_until_complete(coresys.core.stop())
|
||||
executor.shutdown(wait=False)
|
||||
loop.close()
|
||||
|
||||
_LOGGER.info("Close Hass.io")
|
||||
_LOGGER.info("Close Supervisor")
|
||||
sys.exit(0)
|
|
@ -1,4 +1,4 @@
|
|||
"""Init file for Hass.io add-ons."""
|
||||
"""Init file for Supervisor add-ons."""
|
||||
import asyncio
|
||||
from contextlib import suppress
|
||||
import logging
|
||||
|
@ -25,7 +25,7 @@ AnyAddon = Union[Addon, AddonStore]
|
|||
|
||||
|
||||
class AddonManager(CoreSysAttributes):
|
||||
"""Manage add-ons inside Hass.io."""
|
||||
"""Manage add-ons inside Supervisor."""
|
||||
|
||||
def __init__(self, coresys: CoreSys):
|
||||
"""Initialize Docker base wrapper."""
|
||||
|
@ -57,7 +57,7 @@ class AddonManager(CoreSysAttributes):
|
|||
return self.store.get(addon_slug)
|
||||
|
||||
def from_token(self, token: str) -> Optional[Addon]:
|
||||
"""Return an add-on from Hass.io token."""
|
||||
"""Return an add-on from Supervisor token."""
|
||||
for addon in self.installed:
|
||||
if token == addon.hassio_token:
|
||||
return addon
|
|
@ -1,4 +1,4 @@
|
|||
"""Init file for Hass.io add-ons."""
|
||||
"""Init file for Supervisor add-ons."""
|
||||
from contextlib import suppress
|
||||
from copy import deepcopy
|
||||
from ipaddress import IPv4Address
|
||||
|
@ -65,7 +65,7 @@ RE_WEBUI = re.compile(
|
|||
|
||||
|
||||
class Addon(AddonModel):
|
||||
"""Hold data for add-on inside Hass.io."""
|
||||
"""Hold data for add-on inside Supervisor."""
|
||||
|
||||
def __init__(self, coresys: CoreSys, slug: str):
|
||||
"""Initialize data holder."""
|
||||
|
@ -163,12 +163,12 @@ class Addon(AddonModel):
|
|||
|
||||
@property
|
||||
def hassio_token(self) -> Optional[str]:
|
||||
"""Return access token for Hass.io API."""
|
||||
"""Return access token for Supervisor API."""
|
||||
return self.persist.get(ATTR_ACCESS_TOKEN)
|
||||
|
||||
@property
|
||||
def ingress_token(self) -> Optional[str]:
|
||||
"""Return access token for Hass.io API."""
|
||||
"""Return access token for Supervisor API."""
|
||||
return self.persist.get(ATTR_INGRESS_TOKEN)
|
||||
|
||||
@property
|
|
@ -1,4 +1,4 @@
|
|||
"""Hass.io add-on build environment."""
|
||||
"""Supervisor add-on build environment."""
|
||||
from __future__ import annotations
|
||||
from pathlib import Path
|
||||
from typing import TYPE_CHECKING, Dict
|
||||
|
@ -16,7 +16,7 @@ class AddonBuild(JsonConfig, CoreSysAttributes):
|
|||
"""Handle build options for add-ons."""
|
||||
|
||||
def __init__(self, coresys: CoreSys, addon: AnyAddon) -> None:
|
||||
"""Initialize Hass.io add-on builder."""
|
||||
"""Initialize Supervisor add-on builder."""
|
||||
self.coresys: CoreSys = coresys
|
||||
self.addon = addon
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
"""Init file for Hass.io add-on data."""
|
||||
"""Init file for Supervisor add-on data."""
|
||||
from copy import deepcopy
|
||||
import logging
|
||||
from typing import Any, Dict
|
||||
|
@ -23,7 +23,7 @@ Config = Dict[str, Any]
|
|||
|
||||
|
||||
class AddonsData(JsonConfig, CoreSysAttributes):
|
||||
"""Hold data for installed Add-ons inside Hass.io."""
|
||||
"""Hold data for installed Add-ons inside Supervisor."""
|
||||
|
||||
def __init__(self, coresys: CoreSys):
|
||||
"""Initialize data holder."""
|
|
@ -1,4 +1,4 @@
|
|||
"""Init file for Hass.io add-ons."""
|
||||
"""Init file for Supervisor add-ons."""
|
||||
from pathlib import Path
|
||||
from typing import Any, Awaitable, Dict, List, Optional
|
||||
|
||||
|
@ -137,12 +137,12 @@ class AddonModel(CoreSysAttributes):
|
|||
|
||||
@property
|
||||
def hassio_token(self) -> Optional[str]:
|
||||
"""Return access token for Hass.io API."""
|
||||
"""Return access token for Supervisor API."""
|
||||
return None
|
||||
|
||||
@property
|
||||
def ingress_token(self) -> Optional[str]:
|
||||
"""Return access token for Hass.io API."""
|
||||
"""Return access token for Supervisor API."""
|
||||
return None
|
||||
|
||||
@property
|
||||
|
@ -326,7 +326,7 @@ class AddonModel(CoreSysAttributes):
|
|||
|
||||
@property
|
||||
def access_hassio_api(self) -> bool:
|
||||
"""Return True if the add-on access to Hass.io REASTful API."""
|
||||
"""Return True if the add-on access to Supervisor REASTful API."""
|
||||
return self.data[ATTR_HASSIO_API]
|
||||
|
||||
@property
|
||||
|
@ -336,7 +336,7 @@ class AddonModel(CoreSysAttributes):
|
|||
|
||||
@property
|
||||
def hassio_role(self) -> str:
|
||||
"""Return Hass.io role for API."""
|
||||
"""Return Supervisor role for API."""
|
||||
return self.data[ATTR_HASSIO_ROLE]
|
||||
|
||||
@property
|
|
@ -59,7 +59,7 @@ def rating_security(addon: AddonModel) -> int:
|
|||
):
|
||||
rating += -1
|
||||
|
||||
# API Hass.io role
|
||||
# API Supervisor role
|
||||
if addon.hassio_role == ROLE_MANAGER:
|
||||
rating += -1
|
||||
elif addon.hassio_role == ROLE_ADMIN:
|
|
@ -1,4 +1,4 @@
|
|||
"""Init file for Hass.io RESTful API."""
|
||||
"""Init file for Supervisor RESTful API."""
|
||||
import logging
|
||||
from pathlib import Path
|
||||
from typing import Optional
|
||||
|
@ -29,7 +29,7 @@ MAX_CLIENT_SIZE: int = 1024 ** 2 * 16
|
|||
|
||||
|
||||
class RestAPI(CoreSysAttributes):
|
||||
"""Handle RESTful API for Hass.io."""
|
||||
"""Handle RESTful API for Supervisor."""
|
||||
|
||||
def __init__(self, coresys: CoreSys):
|
||||
"""Initialize Docker base wrapper."""
|
||||
|
@ -93,7 +93,7 @@ class RestAPI(CoreSysAttributes):
|
|||
web.post("/os/update", api_hassos.update),
|
||||
web.post("/os/update/cli", api_hassos.update_cli),
|
||||
web.post("/os/config/sync", api_hassos.config_sync),
|
||||
# Remove with old Hass.io fallback
|
||||
# Remove with old Supervisor fallback
|
||||
web.get("/hassos/info", api_hassos.info),
|
||||
web.post("/hassos/update", api_hassos.update),
|
||||
web.post("/hassos/update/cli", api_hassos.update_cli),
|
||||
|
@ -165,7 +165,7 @@ class RestAPI(CoreSysAttributes):
|
|||
web.post("/core/start", api_hass.start),
|
||||
web.post("/core/check", api_hass.check),
|
||||
web.post("/core/rebuild", api_hass.rebuild),
|
||||
# Remove with old Hass.io fallback
|
||||
# Remove with old Supervisor fallback
|
||||
web.get("/homeassistant/info", api_hass.info),
|
||||
web.get("/homeassistant/logs", api_hass.logs),
|
||||
web.get("/homeassistant/stats", api_hass.stats),
|
||||
|
@ -192,7 +192,7 @@ class RestAPI(CoreSysAttributes):
|
|||
web.post("/core/api/{path:.+}", api_proxy.api),
|
||||
web.get("/core/api/{path:.+}", api_proxy.api),
|
||||
web.get("/core/api/", api_proxy.api),
|
||||
# Remove with old Hass.io fallback
|
||||
# Remove with old Supervisor fallback
|
||||
web.get("/homeassistant/api/websocket", api_proxy.websocket),
|
||||
web.get("/homeassistant/websocket", api_proxy.websocket),
|
||||
web.get("/homeassistant/api/stream", api_proxy.stream),
|
|
@ -1,4 +1,4 @@
|
|||
"""Init file for Hass.io Home Assistant RESTful API."""
|
||||
"""Init file for Supervisor Home Assistant RESTful API."""
|
||||
import asyncio
|
||||
import logging
|
||||
from typing import Any, Awaitable, Dict, List
|
|
@ -1,4 +1,4 @@
|
|||
"""Init file for Hass.io auth/SSO RESTful API."""
|
||||
"""Init file for Supervisor auth/SSO RESTful API."""
|
||||
import asyncio
|
||||
import logging
|
||||
from typing import Dict
|
||||
|
@ -76,7 +76,7 @@ class APIAuth(CoreSysAttributes):
|
|||
return await self._process_dict(request, addon, data)
|
||||
|
||||
raise HTTPUnauthorized(
|
||||
headers={WWW_AUTHENTICATE: 'Basic realm="Hass.io Authentication"'}
|
||||
headers={WWW_AUTHENTICATE: 'Basic realm="Home Assistant Authentication"'}
|
||||
)
|
||||
|
||||
@api_process
|
|
@ -1,4 +1,4 @@
|
|||
"""Init file for Hass.io network RESTful API."""
|
||||
"""Init file for Supervisor network RESTful API."""
|
||||
import voluptuous as vol
|
||||
|
||||
from .utils import api_process, api_validate
|
|
@ -1,4 +1,4 @@
|
|||
"""Init file for Hass.io DNS RESTful API."""
|
||||
"""Init file for Supervisor DNS RESTful API."""
|
||||
import asyncio
|
||||
import logging
|
||||
from typing import Any, Awaitable, Dict
|
|
@ -1,4 +1,4 @@
|
|||
"""Init file for Hass.io hardware RESTful API."""
|
||||
"""Init file for Supervisor hardware RESTful API."""
|
||||
import asyncio
|
||||
import logging
|
||||
from typing import Any, Dict
|
|
@ -1,4 +1,4 @@
|
|||
"""Init file for Hass.io HassOS RESTful API."""
|
||||
"""Init file for Supervisor HassOS RESTful API."""
|
||||
import asyncio
|
||||
import logging
|
||||
from typing import Any, Awaitable, Dict
|
|
@ -1,4 +1,4 @@
|
|||
"""Init file for Hass.io Home Assistant RESTful API."""
|
||||
"""Init file for Supervisor Home Assistant RESTful API."""
|
||||
import asyncio
|
||||
import logging
|
||||
from typing import Coroutine, Dict, Any
|
|
@ -1,4 +1,4 @@
|
|||
"""Init file for Hass.io host RESTful API."""
|
||||
"""Init file for Supervisor host RESTful API."""
|
||||
import asyncio
|
||||
import logging
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
"""Init file for Hass.io info RESTful API."""
|
||||
"""Init file for Supervisor info RESTful API."""
|
||||
import logging
|
||||
from typing import Any, Dict
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
"""Hass.io Add-on ingress service."""
|
||||
"""Supervisor Add-on ingress service."""
|
||||
import asyncio
|
||||
from ipaddress import ip_address
|
||||
import logging
|
||||
|
@ -81,7 +81,7 @@ class APIIngress(CoreSysAttributes):
|
|||
async def handler(
|
||||
self, request: web.Request
|
||||
) -> Union[web.Response, web.StreamResponse, web.WebSocketResponse]:
|
||||
"""Route data to Hass.io ingress service."""
|
||||
"""Route data to Supervisor ingress service."""
|
||||
self._check_ha_access(request)
|
||||
|
||||
# Check Ingress Session
|
|
@ -23,7 +23,7 @@ class APIProxy(CoreSysAttributes):
|
|||
"""API Proxy for Home Assistant."""
|
||||
|
||||
def _check_access(self, request: web.Request):
|
||||
"""Check the Hass.io token."""
|
||||
"""Check the Supervisor token."""
|
||||
if AUTHORIZATION in request.headers:
|
||||
bearer = request.headers[AUTHORIZATION]
|
||||
hassio_token = bearer.split(" ")[-1]
|
|
@ -1,4 +1,4 @@
|
|||
"""Init file for Hass.io network RESTful API."""
|
||||
"""Init file for Supervisor network RESTful API."""
|
||||
|
||||
from .utils import api_process, api_validate
|
||||
from ..const import (
|
|
@ -1,4 +1,4 @@
|
|||
"""Init file for Hass.io snapshot RESTful API."""
|
||||
"""Init file for Supervisor snapshot RESTful API."""
|
||||
import asyncio
|
||||
import logging
|
||||
from pathlib import Path
|
|
@ -1,4 +1,4 @@
|
|||
"""Init file for Hass.io Supervisor RESTful API."""
|
||||
"""Init file for Supervisor Supervisor RESTful API."""
|
||||
import asyncio
|
||||
import logging
|
||||
from typing import Any, Awaitable, Dict
|
||||
|
@ -36,7 +36,7 @@ from ..const import (
|
|||
ATTR_VERSION,
|
||||
ATTR_WAIT_BOOT,
|
||||
CONTENT_TYPE_BINARY,
|
||||
HASSIO_VERSION,
|
||||
SUPERVISOR_VERSION,
|
||||
UpdateChannels,
|
||||
)
|
||||
from ..coresys import CoreSysAttributes
|
||||
|
@ -91,7 +91,7 @@ class APISupervisor(CoreSysAttributes):
|
|||
)
|
||||
|
||||
return {
|
||||
ATTR_VERSION: HASSIO_VERSION,
|
||||
ATTR_VERSION: SUPERVISOR_VERSION,
|
||||
ATTR_LAST_VERSION: self.sys_updater.version_hassio,
|
||||
ATTR_CHANNEL: self.sys_updater.channel,
|
||||
ATTR_ARCH: self.sys_supervisor.arch,
|
|
@ -1,4 +1,4 @@
|
|||
"""Init file for Hass.io util for RESTful API."""
|
||||
"""Init file for Supervisor util for RESTful API."""
|
||||
import json
|
||||
import logging
|
||||
from typing import Any, Dict, List, Optional
|
||||
|
@ -29,7 +29,7 @@ def excract_supervisor_token(request: web.Request) -> Optional[str]:
|
|||
if supervisor_token:
|
||||
return supervisor_token
|
||||
|
||||
# Remove with old Hass.io fallback
|
||||
# Remove with old Supervisor fallback
|
||||
supervisor_token = request.headers.get(HEADER_TOKEN_OLD)
|
||||
if supervisor_token:
|
||||
return supervisor_token
|
|
@ -1,4 +1,4 @@
|
|||
"""Bootstrap Hass.io."""
|
||||
"""Bootstrap Supervisor."""
|
||||
import logging
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
@ -12,7 +12,7 @@ from .api import RestAPI
|
|||
from .arch import CpuArch
|
||||
from .auth import Auth
|
||||
from .const import SOCKET_DOCKER, UpdateChannels
|
||||
from .core import HassIO
|
||||
from .core import Core
|
||||
from .coresys import CoreSys
|
||||
from .dbus import DBusManager
|
||||
from .discovery import Discovery
|
||||
|
@ -40,11 +40,11 @@ MACHINE_ID = Path("/etc/machine-id")
|
|||
|
||||
|
||||
async def initialize_coresys():
|
||||
"""Initialize HassIO coresys/objects."""
|
||||
"""Initialize supervisor coresys/objects."""
|
||||
coresys = CoreSys()
|
||||
|
||||
# Initialize core objects
|
||||
coresys.core = HassIO(coresys)
|
||||
coresys.core = Core(coresys)
|
||||
coresys.dns = CoreDNS(coresys)
|
||||
coresys.arch = CpuArch(coresys)
|
||||
coresys.auth = Auth(coresys)
|
||||
|
@ -89,51 +89,53 @@ def initialize_system_data(coresys: CoreSys):
|
|||
)
|
||||
config.path_homeassistant.mkdir()
|
||||
|
||||
# hassio ssl folder
|
||||
# supervisor ssl folder
|
||||
if not config.path_ssl.is_dir():
|
||||
_LOGGER.info("Create Hass.io SSL/TLS folder %s", config.path_ssl)
|
||||
_LOGGER.info("Create Supervisor SSL/TLS folder %s", config.path_ssl)
|
||||
config.path_ssl.mkdir()
|
||||
|
||||
# hassio addon data folder
|
||||
# supervisor addon data folder
|
||||
if not config.path_addons_data.is_dir():
|
||||
_LOGGER.info("Create Hass.io Add-on data folder %s", config.path_addons_data)
|
||||
_LOGGER.info("Create Supervisor Add-on data folder %s", config.path_addons_data)
|
||||
config.path_addons_data.mkdir(parents=True)
|
||||
|
||||
if not config.path_addons_local.is_dir():
|
||||
_LOGGER.info(
|
||||
"Create Hass.io Add-on local repository folder %s", config.path_addons_local
|
||||
"Create Supervisor Add-on local repository folder %s",
|
||||
config.path_addons_local,
|
||||
)
|
||||
config.path_addons_local.mkdir(parents=True)
|
||||
|
||||
if not config.path_addons_git.is_dir():
|
||||
_LOGGER.info(
|
||||
"Create Hass.io Add-on git repositories folder %s", config.path_addons_git
|
||||
"Create Supervisor Add-on git repositories folder %s",
|
||||
config.path_addons_git,
|
||||
)
|
||||
config.path_addons_git.mkdir(parents=True)
|
||||
|
||||
# hassio tmp folder
|
||||
# supervisor tmp folder
|
||||
if not config.path_tmp.is_dir():
|
||||
_LOGGER.info("Create Hass.io temp folder %s", config.path_tmp)
|
||||
_LOGGER.info("Create Supervisor temp folder %s", config.path_tmp)
|
||||
config.path_tmp.mkdir(parents=True)
|
||||
|
||||
# hassio backup folder
|
||||
# supervisor backup folder
|
||||
if not config.path_backup.is_dir():
|
||||
_LOGGER.info("Create Hass.io backup folder %s", config.path_backup)
|
||||
_LOGGER.info("Create Supervisor backup folder %s", config.path_backup)
|
||||
config.path_backup.mkdir()
|
||||
|
||||
# share folder
|
||||
if not config.path_share.is_dir():
|
||||
_LOGGER.info("Create Hass.io share folder %s", config.path_share)
|
||||
_LOGGER.info("Create Supervisor share folder %s", config.path_share)
|
||||
config.path_share.mkdir()
|
||||
|
||||
# apparmor folder
|
||||
if not config.path_apparmor.is_dir():
|
||||
_LOGGER.info("Create Hass.io Apparmor folder %s", config.path_apparmor)
|
||||
_LOGGER.info("Create Supervisor Apparmor folder %s", config.path_apparmor)
|
||||
config.path_apparmor.mkdir()
|
||||
|
||||
# dns folder
|
||||
if not config.path_dns.is_dir():
|
||||
_LOGGER.info("Create Hass.io DNS folder %s", config.path_dns)
|
||||
_LOGGER.info("Create Supervisor DNS folder %s", config.path_dns)
|
||||
config.path_dns.mkdir()
|
||||
|
||||
# Update log level
|
||||
|
@ -239,7 +241,7 @@ def supervisor_debugger(coresys: CoreSys) -> None:
|
|||
# pylint: disable=import-outside-toplevel
|
||||
import ptvsd
|
||||
|
||||
_LOGGER.info("Initialize Hass.io debugger")
|
||||
_LOGGER.info("Initialize Supervisor debugger")
|
||||
|
||||
ptvsd.enable_attach(address=("0.0.0.0", 33333), redirect_output=True)
|
||||
if coresys.config.debug_block:
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue