Skip to content

Commit e1b9cbe

Browse files
committed
HW/SW Inventory: Fix integration tests
Change-Id: I4e2c9eb7c54c9eaa0bbd9f39997d67a07036dbc0
1 parent 5d94f8d commit e1b9cbe

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

cmk/base/modes/check_mk.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1376,9 +1376,10 @@ def mode_flush(hosts: list[HostName]) -> None:
13761376

13771377
# inventory
13781378
inventory_tree = InventoryPaths(cmk.utils.paths.omd_root).inventory_tree(host)
1379-
inventory_tree.path.unlink(missing_ok=True)
1380-
inventory_tree.legacy.unlink(missing_ok=True)
1381-
print_(tty.bold + tty.yellow + " inventory")
1379+
if inventory_tree.path.exists() or inventory_tree.legacy.exists():
1380+
inventory_tree.path.unlink(missing_ok=True)
1381+
inventory_tree.legacy.unlink(missing_ok=True)
1382+
print_(tty.bold + tty.yellow + " inventory")
13821383

13831384
if not flushed:
13841385
print_("(nothing)")

0 commit comments

Comments
 (0)