Reformat files with black

This commit is contained in:
deajan 2024-09-17 15:02:55 +02:00
parent 5f211ca0ba
commit d025a57346
4 changed files with 11 additions and 8 deletions

View file

@ -107,8 +107,9 @@ def run_upgrade(full_config: dict, ignore_errors: bool = False) -> bool:
logger.warning(f"Missing auto upgrade info, cannot launch auto upgrade")
return False
evaluated_full_config = npbackup.configuration.evaluate_variables(full_config, full_config)
evaluated_full_config = npbackup.configuration.evaluate_variables(
full_config, full_config
)
auto_upgrade_host_identity = evaluated_full_config.g(
"global_options.auto_upgrade_host_identity"
)

View file

@ -148,9 +148,7 @@ def auto_upgrader(
if IS_LEGACY:
platform_and_arch += "-legacy"
try:
host_id = "{}/{}/{}".format(
auto_upgrade_host_identity, npbackup_version, group
)
host_id = "{}/{}/{}".format(auto_upgrade_host_identity, npbackup_version, group)
id_record = "{}/{}".format(platform_and_arch, host_id)
except TypeError:
id_record = platform_and_arch

View file

@ -124,7 +124,9 @@ async def current_version(
)
@app.get("/upgrades/{platform}/{arch}", response_model=Union[FileSend, dict], status_code=200)
@app.get(
"/upgrades/{platform}/{arch}", response_model=Union[FileSend, dict], status_code=200
)
@app.get(
"/upgrades/{platform}/{arch}/{auto_upgrade_host_identity}",
response_model=Union[FileSend, dict],

View file

@ -86,7 +86,9 @@ def get_current_version() -> Optional[CurrentVersion]:
logger.error("Trace:", exc_info=True)
def get_file(file: FileGet, content: bool = False) -> Optional[Union[FileSend, bytes, dict]]:
def get_file(
file: FileGet, content: bool = False
) -> Optional[Union[FileSend, bytes, dict]]:
possible_filename = "npbackup.zip"
path = os.path.join(
config_dict["upgrades"]["data_root"],