Split inventory from the device module and started working on vm inventory support

This commit is contained in:
Raymond Kuiper
2024-12-19 16:26:18 +01:00
parent b0eee8ad9b
commit c76e36ad38
7 changed files with 344 additions and 47 deletions

View File

@@ -6,9 +6,12 @@ from os import sys
from modules.device import PhysicalDevice
from modules.hostgroups import Hostgroup
from modules.interface import ZabbixInterface
from modules.inventory import Inventory
from modules.exceptions import TemplateError, InterfaceConfigError, SyncInventoryError
try:
from config import (
inventory_sync,
vm_inventory_map,
traverse_site_groups,
traverse_regions
)
@@ -35,6 +38,10 @@ class VirtualMachine(PhysicalDevice):
# Generate hostgroup based on hostgroup format
self.hostgroup = hg.generate(hg_format)
def set_inventory(self, nbvm):
""" Set inventory """
Inventory.set_inventory(self, nbvm)
def set_vm_template(self):
""" Set Template for VMs. Overwrites default class
to skip a lookup of custom fields."""