We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 05badce commit 7c9c69aCopy full SHA for 7c9c69a
1 file changed
netbox-sync.py
@@ -87,6 +87,13 @@ def main():
87
log.info("Initializing sources")
88
sources = instantiate_sources()
89
90
+ # disable pruning if an enabled source is unavailable
91
+ if nb_handler.settings.prune_enabled is True:
92
+ for source in inventory.source_list:
93
+ if getattr(source.settings, "enabled", False) is True and source.init_successful is False:
94
+ nb_handler.settings.prune_enabled = False
95
+ log.warning(f"disabling pruning as source '{source.name}' is unavailable")
96
+
97
# all sources are unavailable
98
if len(sources) == 0:
99
log.error("No working sources found. Exit.")
0 commit comments