mirror of
https://github.com/netinvent/npbackup.git
synced 2025-10-30 07:17:05 +08:00
Simplify exclusion expansion code
This commit is contained in:
parent
da81108d41
commit
d891d90876
1 changed files with 7 additions and 8 deletions
|
|
@ -847,18 +847,17 @@ class ResticRunner:
|
|||
if os.path.isfile(exclude_file):
|
||||
cmd += f' --{case_ignore_param}exclude-file "{exclude_file}"'
|
||||
else:
|
||||
expansion_path = os.path.join(
|
||||
CURRENT_DIR, "excludes", os.path.basename(exclude_file)
|
||||
)
|
||||
self.write_logs(
|
||||
f"Trying to expanding exclude file path to {os.path.join(CURRENT_DIR, 'excludes', os.path.basename(exclude_file))}",
|
||||
f"Trying to expanding exclude file path to {expansion_path}",
|
||||
level="info",
|
||||
)
|
||||
if os.path.isfile(
|
||||
os.path.join(
|
||||
CURRENT_DIR, "excludes", os.path.basename(exclude_file)
|
||||
if os.path.isfile(expansion_path):
|
||||
cmd += (
|
||||
f' --{case_ignore_param}exclude-file "{expansion_path}"'
|
||||
)
|
||||
):
|
||||
|
||||
cmd += f' --{case_ignore_param}exclude-file "{os.path.join(CURRENT_DIR, os.path.basename(exclude_file))}"'
|
||||
|
||||
else:
|
||||
self.write_logs(
|
||||
f"Exclude file '{exclude_file}' not found",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue