diff --git a/bin/sign_windows.py b/bin/sign_windows.py index 277cbdd..69fecbd 100644 --- a/bin/sign_windows.py +++ b/bin/sign_windows.py @@ -28,4 +28,6 @@ for audience in audiences: exe_path = os.path.join(basepath, audience, "windows", arch, binary) result = signer.sign(exe_path, bitness=arch) if not result: - raise EnvironmentError("Could not sign executable ! Is the PKI key connected ?") \ No newline at end of file + raise EnvironmentError( + "Could not sign executable ! Is the PKI key connected ?" + ) diff --git a/npbackup/core/runner.py b/npbackup/core/runner.py index 8f84fa1..ff26b87 100644 --- a/npbackup/core/runner.py +++ b/npbackup/core/runner.py @@ -80,9 +80,15 @@ def metric_writer(config_dict: dict, restic_result: bool, result_string: str): if additional_label: try: label, value = additional_label.split("=") - label_string += ',{}="{}"'.format(label.strip(), value.strip()) + label_string += ',{}="{}"'.format( + label.strip(), value.strip() + ) except ValueError: - logger.error("Bogus additional label \"{}\" defined in configuration.".format(additional_label)) + logger.error( + 'Bogus additional label "{}" defined in configuration.'.format( + additional_label + ) + ) except (KeyError, AttributeError, TypeError): logger.error("Bogus additional labels defined in configuration.") logger.debug("Trace:", exc_info=True) @@ -360,12 +366,15 @@ class NPBackupRunner: key, value = env_variable.split("=") expanded_env_vars[key.strip()] = value.strip() except ValueError: - logger.error("Bogus environment variable \"{}\" defined in configuration.".format(env_variable)) + logger.error( + 'Bogus environment variable "{}" defined in configuration.'.format( + env_variable + ) + ) except (KeyError, AttributeError, TypeError): logger.error("Bogus environment variables defined in configuration.") logger.debug("Trace:", exc_info=True) - try: self.restic_runner.environment_variables = expanded_env_vars except ValueError: diff --git a/npbackup/gui/config.py b/npbackup/gui/config.py index f57c96d..5885131 100644 --- a/npbackup/gui/config.py +++ b/npbackup/gui/config.py @@ -76,7 +76,7 @@ def config_gui(config_dict: dict, config_file: str): "password_command", "auto_upgrade_server_username", "auto_upgrade_server_password", - "encrypted_variables" + "encrypted_variables", ]: try: if ( diff --git a/npbackup/restic_metrics/__init__.py b/npbackup/restic_metrics/__init__.py index d720b8f..ebf8b09 100644 --- a/npbackup/restic_metrics/__init__.py +++ b/npbackup/restic_metrics/__init__.py @@ -241,7 +241,12 @@ def upload_metrics(destination, authentication, no_cert_verify, metrics): data += "{}\n".format(metric) logger.debug("metrics:\n{}".format(data)) result = requests.post( - destination, headers=headers, data=data, auth=authentication, timeout=4, verify=not no_cert_verify + destination, + headers=headers, + data=data, + auth=authentication, + timeout=4, + verify=not no_cert_verify, ) if result.status_code == 200: logger.info("Metrics pushed succesfully.") diff --git a/npbackup/restic_wrapper/__init__.py b/npbackup/restic_wrapper/__init__.py index 4dcacc2..c4f9731 100644 --- a/npbackup/restic_wrapper/__init__.py +++ b/npbackup/restic_wrapper/__init__.py @@ -104,7 +104,7 @@ class ResticRunner: self.repository = None for env_variable, value in self.environment_variables.items(): - logger.warning("Setting envrionment variable \"{}\"".format(env_variable)) + logger.warning('Setting envrionment variable "{}"'.format(env_variable)) os.environ[env_variable] = value def _remove_env(self) -> None: