mirror of
https://github.com/netinvent/npbackup.git
synced 2025-09-13 00:16:21 +08:00
Don't expand config to empty strings
This commit is contained in:
parent
0f6436ea15
commit
2e363593b9
2 changed files with 4 additions and 1 deletions
|
@ -376,6 +376,8 @@ def evaluate_variables(repo_config: dict, full_config: dict) -> dict:
|
|||
|
||||
if "${HOSTNAME}" in value:
|
||||
value = value.replace("${HOSTNAME}", platform.node())
|
||||
if value == "":
|
||||
value = None
|
||||
return value
|
||||
|
||||
# We need to make a loop to catch all nested variables (ie variable in a variable)
|
||||
|
|
|
@ -178,7 +178,8 @@ def restic_json_to_prometheus(
|
|||
"""
|
||||
_labels = []
|
||||
for key, value in labels.items():
|
||||
_labels.append(f'{key.strip()}="{value.strip()}"')
|
||||
if value:
|
||||
_labels.append(f'{key.strip()}="{value.strip()}"')
|
||||
labels = ",".join(_labels)
|
||||
|
||||
# Take last line of restic output
|
||||
|
|
Loading…
Add table
Reference in a new issue