forked from home-assistant/supervisor
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Backup and restore track progress in job (home-assistant#4503)
* Backup and restore track progress in job * Change to stage only updates and fix tests * Leave HA alone if it wasn't restored * skip check HA stage message when we don't check * Change to helper to get current job * Fix tests * Mark jobs as internal to skip notifying HA
- Loading branch information
Showing
27 changed files
with
892 additions
and
215 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,37 @@ | ||
"""Backup consts.""" | ||
from enum import Enum | ||
from enum import StrEnum | ||
|
||
BUF_SIZE = 2**20 * 4 # 4MB | ||
|
||
|
||
class BackupType(str, Enum): | ||
class BackupType(StrEnum): | ||
"""Backup type enum.""" | ||
|
||
FULL = "full" | ||
PARTIAL = "partial" | ||
|
||
|
||
class BackupJobStage(StrEnum): | ||
"""Backup job stage enum.""" | ||
|
||
ADDON_REPOSITORIES = "addon_repositories" | ||
ADDONS = "addons" | ||
DOCKER_CONFIG = "docker_config" | ||
FINISHING_FILE = "finishing_file" | ||
FOLDERS = "folders" | ||
HOME_ASSISTANT = "home_assistant" | ||
AWAIT_ADDON_RESTARTS = "await_addon_restarts" | ||
|
||
|
||
class RestoreJobStage(StrEnum): | ||
"""Restore job stage enum.""" | ||
|
||
ADDON_REPOSITORIES = "addon_repositories" | ||
ADDONS = "addons" | ||
AWAIT_ADDON_RESTARTS = "await_addon_restarts" | ||
AWAIT_HOME_ASSISTANT_RESTART = "await_home_assistant_restart" | ||
CHECK_HOME_ASSISTANT = "check_home_assistant" | ||
DOCKER_CONFIG = "docker_config" | ||
FOLDERS = "folders" | ||
HOME_ASSISTANT = "home_assistant" | ||
REMOVE_DELTA_ADDONS = "remove_delta_addons" |
Oops, something went wrong.