mirror of
https://github.com/TheNetworkGuy/netbox-zabbix-sync.git
synced 2025-12-19 20:02:20 -06:00
Split inventory from the device module and started working on vm inventory support
This commit is contained in:
@@ -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."""
|
||||
|
||||
Reference in New Issue
Block a user