mirror of
https://github.com/netinvent/npbackup.git
synced 2025-09-09 06:25:59 +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:
|
||||
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:
|
||||
logger.info("No global prometheus settings found")
|
||||
|
||||
|
|
|
@ -200,6 +200,7 @@ class NPBackupRunner:
|
|||
|
||||
@verbose.setter
|
||||
def verbose(self, value):
|
||||
logger.info("Verbosity mode set")
|
||||
if not isinstance(value, bool):
|
||||
msg = f"Bogus verbose parameter given: {value}"
|
||||
self.write_logs(msg, level="critical", raise_error="ValueError")
|
||||
|
|
|
@ -249,10 +249,10 @@ def config_gui(full_config: dict, config_file: str):
|
|||
try:
|
||||
if combo_value.startswith("Repo: "):
|
||||
object_type = "repos"
|
||||
object_name = combo_value[len("Repo: "):]
|
||||
object_name = combo_value[len("Repo: ") :]
|
||||
elif combo_value.startswith("Group: "):
|
||||
object_type = "groups"
|
||||
object_name = combo_value[len("Group: "):]
|
||||
object_name = combo_value[len("Group: ") :]
|
||||
else:
|
||||
object_type = None
|
||||
object_name = None
|
||||
|
@ -2609,7 +2609,7 @@ Google Cloud storage: GOOGLE_PROJECT_ID GOOGLE_APPLICATION_CREDENTIALS\n\
|
|||
):
|
||||
break
|
||||
|
||||
if event == "-OBJECT-SELECT-" or event == "repo_group":
|
||||
if event in ("-OBJECT-SELECT-", "repo_group"):
|
||||
# Update full_config with current object before updating
|
||||
full_config = update_config_dict(
|
||||
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",
|
||||
}
|
||||
|
||||
data = ""
|
||||
for metric in metrics:
|
||||
data += f"{metric}\n"
|
||||
data = "\n".join(metrics) + "\n"
|
||||
result = requests.post(
|
||||
destination,
|
||||
headers=headers,
|
||||
|
|
|
@ -674,7 +674,6 @@ class ResticRunner:
|
|||
self.write_logs(
|
||||
"Cannot get backend version: No binary defined.", level="error"
|
||||
)
|
||||
return None
|
||||
|
||||
@property
|
||||
def generic_arguments(self):
|
||||
|
|
|
@ -42,7 +42,6 @@ def serialize_datetime(obj):
|
|||
|
||||
|
||||
def entrypoint(*args, **kwargs):
|
||||
verbose = kwargs.pop("verbose", False)
|
||||
repo_config = kwargs.pop("repo_config", None)
|
||||
json_output = kwargs.pop("json_output")
|
||||
operation = kwargs.pop("operation")
|
||||
|
@ -51,9 +50,8 @@ def entrypoint(*args, **kwargs):
|
|||
npbackup_runner = NPBackupRunner()
|
||||
if repo_config:
|
||||
npbackup_runner.repo_config = repo_config
|
||||
npbackup_runner.verbose = verbose
|
||||
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.json_output = json_output
|
||||
npbackup_runner.no_cache = kwargs.pop("no_cache", False)
|
||||
|
|
Loading…
Add table
Reference in a new issue