From 6ef23eae4d60715ed530331cb29382c5747f7c60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Compagnon?= Date: Mon, 21 Aug 2023 20:38:41 +0200 Subject: [PATCH] Add missing prtint debug --- netbox_agent/virtualmachine.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/netbox_agent/virtualmachine.py b/netbox_agent/virtualmachine.py index 3b3f89c..314c2c3 100644 --- a/netbox_agent/virtualmachine.py +++ b/netbox_agent/virtualmachine.py @@ -7,6 +7,7 @@ from netbox_agent.location import Tenant from netbox_agent.logging import logging # NOQA from netbox_agent.misc import create_netbox_tags, get_hostname, get_device_platform from netbox_agent.network import VirtualNetwork +from pprint import pprint def is_vm(dmi): @@ -138,3 +139,14 @@ class VirtualMachine(object): if updated: vm.save() + + def print_debug(self): + self.network = VirtualNetwork(server=self) + print('Cluster:', self.get_netbox_cluster(config.virtual.cluster_name)) + print('Platform:', self.device_platform) + print('VM:', self.get_netbox_vm()) + print('vCPU:', self.get_vcpus()) + print('Memory:', f"{self.get_memory()} MB") + print('NIC:',) + pprint(self.network.get_network_cards()) + pass