Make IPMI information gathering optional.

This commit is contained in:
Clay Sweetser 2023-02-27 19:06:14 -05:00
parent 7259c7602d
commit dc224e209b
2 changed files with 5 additions and 1 deletions

View file

@ -78,6 +78,7 @@ def get_config():
help='Regex to ignore interfaces')
p.add_argument('--network.ignore_ips', default=r'^(127\.0\.0\..*|fe80.*|::1.*)',
help='Regex to ignore IPs')
p.add_argument('--network.ipmi', default=True, help='Enable gathering IPMI information')
p.add_argument('--network.lldp', help='Enable auto-cabling feature through LLDP infos')
p.add_argument('--inventory', action='store_true',
help='Enable HW inventory (CPU, Memory, RAID Cards, Disks) feature')

View file

@ -496,9 +496,12 @@ class Network(object):
class ServerNetwork(Network):
def __init__(self, server, *args, **kwargs):
super(ServerNetwork, self).__init__(server, args, kwargs)
self.ipmi = self.get_ipmi()
if config.network.ipmi:
self.ipmi = self.get_ipmi()
if self.ipmi:
self.nics.append(self.ipmi)
self.server = server
self.device = self.server.get_netbox_server()
self.nb_net = nb.dcim