mirror of
https://github.com/netinvent/npbackup.git
synced 2025-11-09 21:51:41 +08:00
Reformat files with black
This commit is contained in:
parent
6279849336
commit
a801925571
5 changed files with 9 additions and 10 deletions
|
|
@ -452,16 +452,16 @@ def inject_permissions_into_full_config(full_config: dict) -> Tuple[bool, dict]:
|
|||
f"repos.{repo}.__current_manager_password"
|
||||
)
|
||||
|
||||
if (
|
||||
__current_manager_password and manager_password
|
||||
):
|
||||
if __current_manager_password and manager_password:
|
||||
if __current_manager_password == manager_password:
|
||||
full_config.s(
|
||||
f"repos.{repo}.repo_uri", (repo_uri, permissions, manager_password)
|
||||
)
|
||||
full_config.s(f"repos.{repo}.is_protected", True)
|
||||
else:
|
||||
logger.error(f"Wrong manager password given for repo {repo}. Will not update permissions")
|
||||
logger.error(
|
||||
f"Wrong manager password given for repo {repo}. Will not update permissions"
|
||||
)
|
||||
else:
|
||||
logger.debug(f"Permissions exist for repo {repo}")
|
||||
|
||||
|
|
|
|||
|
|
@ -392,7 +392,7 @@ class NPBackupRunner:
|
|||
current_permissions = self.repo_config.g("permissions")
|
||||
if not current_permissions in required_permissions[operation]:
|
||||
self.write_logs(
|
||||
f"Permissions required for operation \'{operation}\' are {required_permissions[operation]}, current permissions are {current_permissions}",
|
||||
f"Permissions required for operation '{operation}' are {required_permissions[operation]}, current permissions are {current_permissions}",
|
||||
level="critical",
|
||||
)
|
||||
raise PermissionError
|
||||
|
|
|
|||
|
|
@ -663,7 +663,6 @@ def _main_gui(viewer_mode: bool):
|
|||
config_file = None
|
||||
full_config = None
|
||||
backend_type = None
|
||||
|
||||
|
||||
right_click_menu = ["", [_t("generic.destination")]]
|
||||
headings = [
|
||||
|
|
|
|||
|
|
@ -628,9 +628,7 @@ def config_gui(full_config: dict, config_file: str):
|
|||
],
|
||||
[
|
||||
sg.Input(visible=False, key="--ADD-PATHS-FILE--", enable_events=True),
|
||||
sg.FilesBrowse(
|
||||
_t("generic.add_files"), target="--ADD-PATHS-FILE--"
|
||||
),
|
||||
sg.FilesBrowse(_t("generic.add_files"), target="--ADD-PATHS-FILE--"),
|
||||
sg.Input(visible=False, key="--ADD-PATHS-FOLDER--", enable_events=True),
|
||||
sg.FolderBrowse(
|
||||
_t("generic.add_folder"), target="--ADD-PATHS-FOLDER--"
|
||||
|
|
|
|||
|
|
@ -236,7 +236,9 @@ def restic_json_to_prometheus(
|
|||
|
||||
prom_metrics.append(
|
||||
'restic_backup_failure{{{},timestamp="{}"}} {}'.format(
|
||||
labels, int(datetime.now(timezone.utc).timestamp()), 1 if not good_backup else 0
|
||||
labels,
|
||||
int(datetime.now(timezone.utc).timestamp()),
|
||||
1 if not good_backup else 0,
|
||||
)
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue