mirror of
https://github.com/FAUSheppy/athq-vm-management
synced 2025-12-06 05:41:35 +01:00
fix: check for invalid entries
This commit is contained in:
10
backup.py
10
backup.py
@@ -3,6 +3,7 @@ import functools
|
|||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
import json
|
import json
|
||||||
|
import sys
|
||||||
|
|
||||||
environment = jinja2.Environment(loader=jinja2.FileSystemLoader(searchpath="./templates"))
|
environment = jinja2.Environment(loader=jinja2.FileSystemLoader(searchpath="./templates"))
|
||||||
|
|
||||||
@@ -20,6 +21,15 @@ def createBackupScriptStructure(backupList, baseDomain="", icingaOnly=False, bac
|
|||||||
asyncIcingaConf = {}
|
asyncIcingaConf = {}
|
||||||
for backup in backupList:
|
for backup in backupList:
|
||||||
|
|
||||||
|
if not backup:
|
||||||
|
print("Warning: Empty backup mapping in List", file=sys.stderr)
|
||||||
|
continue
|
||||||
|
|
||||||
|
if type(backup) == str:
|
||||||
|
print(f"Warning: Backup Entry is a stirng instead of a dict-object ({backup})", file=sys.stderr)
|
||||||
|
continue
|
||||||
|
|
||||||
|
|
||||||
if backup.get("disabled"):
|
if backup.get("disabled"):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user