mirror of
https://github.com/netinvent/npbackup.git
synced 2025-09-13 16:35:43 +08:00
Empty env variables expansion should not create an error
This commit is contained in:
parent
2ff609f2f1
commit
0faa3b374b
1 changed files with 10 additions and 3 deletions
|
@ -851,9 +851,16 @@ class NPBackupRunner:
|
|||
for env_variable in env_variables:
|
||||
if isinstance(env_variable, dict):
|
||||
for k, v in env_variable.items():
|
||||
v = os.path.expanduser(v)
|
||||
v = os.path.expandvars(v)
|
||||
expanded_env_vars[k.strip()] = v.strip()
|
||||
try:
|
||||
v = os.path.expanduser(v)
|
||||
v = os.path.expandvars(v)
|
||||
expanded_env_vars[k.strip()] = v.strip()
|
||||
except Exception as exc:
|
||||
self.write_logs(
|
||||
f"Cannot expand environment variable {k}: {exc}",
|
||||
level="error",
|
||||
)
|
||||
logger.debug("Trace:", exc_info=True)
|
||||
|
||||
try:
|
||||
self.restic_runner.environment_variables = expanded_env_vars
|
||||
|
|
Loading…
Add table
Reference in a new issue