mirror of
https://github.com/netinvent/npbackup.git
synced 2025-11-11 06:32:15 +08:00
Another set of linter fixes
This commit is contained in:
parent
b720b74649
commit
0014147654
6 changed files with 9 additions and 11 deletions
|
|
@ -753,7 +753,9 @@ def get_repo_config(
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if full_config.g("global_prometheus"):
|
if full_config.g("global_prometheus"):
|
||||||
repo_config.s("global_prometheus", deepcopy(full_config.g("global_prometheus")))
|
repo_config.s(
|
||||||
|
"global_prometheus", deepcopy(full_config.g("global_prometheus"))
|
||||||
|
)
|
||||||
except KeyError:
|
except KeyError:
|
||||||
logger.info("No global prometheus settings found")
|
logger.info("No global prometheus settings found")
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -200,6 +200,7 @@ class NPBackupRunner:
|
||||||
|
|
||||||
@verbose.setter
|
@verbose.setter
|
||||||
def verbose(self, value):
|
def verbose(self, value):
|
||||||
|
logger.info("Verbosity mode set")
|
||||||
if not isinstance(value, bool):
|
if not isinstance(value, bool):
|
||||||
msg = f"Bogus verbose parameter given: {value}"
|
msg = f"Bogus verbose parameter given: {value}"
|
||||||
self.write_logs(msg, level="critical", raise_error="ValueError")
|
self.write_logs(msg, level="critical", raise_error="ValueError")
|
||||||
|
|
|
||||||
|
|
@ -249,10 +249,10 @@ def config_gui(full_config: dict, config_file: str):
|
||||||
try:
|
try:
|
||||||
if combo_value.startswith("Repo: "):
|
if combo_value.startswith("Repo: "):
|
||||||
object_type = "repos"
|
object_type = "repos"
|
||||||
object_name = combo_value[len("Repo: "):]
|
object_name = combo_value[len("Repo: ") :]
|
||||||
elif combo_value.startswith("Group: "):
|
elif combo_value.startswith("Group: "):
|
||||||
object_type = "groups"
|
object_type = "groups"
|
||||||
object_name = combo_value[len("Group: "):]
|
object_name = combo_value[len("Group: ") :]
|
||||||
else:
|
else:
|
||||||
object_type = None
|
object_type = None
|
||||||
object_name = None
|
object_name = None
|
||||||
|
|
@ -2609,7 +2609,7 @@ Google Cloud storage: GOOGLE_PROJECT_ID GOOGLE_APPLICATION_CREDENTIALS\n\
|
||||||
):
|
):
|
||||||
break
|
break
|
||||||
|
|
||||||
if event == "-OBJECT-SELECT-" or event == "repo_group":
|
if event in ("-OBJECT-SELECT-", "repo_group"):
|
||||||
# Update full_config with current object before updating
|
# Update full_config with current object before updating
|
||||||
full_config = update_config_dict(
|
full_config = update_config_dict(
|
||||||
full_config, current_object_type, current_object_name, values
|
full_config, current_object_type, current_object_name, values
|
||||||
|
|
|
||||||
|
|
@ -496,9 +496,7 @@ def upload_metrics(destination: str, authentication, no_cert_verify: bool, metri
|
||||||
"Content-type": "text/html",
|
"Content-type": "text/html",
|
||||||
}
|
}
|
||||||
|
|
||||||
data = ""
|
data = "\n".join(metrics) + "\n"
|
||||||
for metric in metrics:
|
|
||||||
data += f"{metric}\n"
|
|
||||||
result = requests.post(
|
result = requests.post(
|
||||||
destination,
|
destination,
|
||||||
headers=headers,
|
headers=headers,
|
||||||
|
|
|
||||||
|
|
@ -674,7 +674,6 @@ class ResticRunner:
|
||||||
self.write_logs(
|
self.write_logs(
|
||||||
"Cannot get backend version: No binary defined.", level="error"
|
"Cannot get backend version: No binary defined.", level="error"
|
||||||
)
|
)
|
||||||
return None
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def generic_arguments(self):
|
def generic_arguments(self):
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,6 @@ def serialize_datetime(obj):
|
||||||
|
|
||||||
|
|
||||||
def entrypoint(*args, **kwargs):
|
def entrypoint(*args, **kwargs):
|
||||||
verbose = kwargs.pop("verbose", False)
|
|
||||||
repo_config = kwargs.pop("repo_config", None)
|
repo_config = kwargs.pop("repo_config", None)
|
||||||
json_output = kwargs.pop("json_output")
|
json_output = kwargs.pop("json_output")
|
||||||
operation = kwargs.pop("operation")
|
operation = kwargs.pop("operation")
|
||||||
|
|
@ -51,9 +50,8 @@ def entrypoint(*args, **kwargs):
|
||||||
npbackup_runner = NPBackupRunner()
|
npbackup_runner = NPBackupRunner()
|
||||||
if repo_config:
|
if repo_config:
|
||||||
npbackup_runner.repo_config = repo_config
|
npbackup_runner.repo_config = repo_config
|
||||||
npbackup_runner.verbose = verbose
|
|
||||||
npbackup_runner.dry_run = kwargs.pop("dry_run")
|
npbackup_runner.dry_run = kwargs.pop("dry_run")
|
||||||
npbackup_runner.verbose = kwargs.pop("verbose")
|
npbackup_runner.verbose = kwargs.pop("verbose", False)
|
||||||
npbackup_runner.live_output = not json_output
|
npbackup_runner.live_output = not json_output
|
||||||
npbackup_runner.json_output = json_output
|
npbackup_runner.json_output = json_output
|
||||||
npbackup_runner.no_cache = kwargs.pop("no_cache", False)
|
npbackup_runner.no_cache = kwargs.pop("no_cache", False)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue