updated to skip ib interfaces
This commit is contained in:
parent
82eb67c2c0
commit
15205bde97
2 changed files with 92 additions and 85 deletions
3
.vscode/settings.json
vendored
Normal file
3
.vscode/settings.json
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"python.analysis.typeCheckingMode": "basic"
|
||||
}
|
|
@ -54,6 +54,11 @@ class Network(object):
|
|||
logging.debug('Ignore interface {interface}'.format(interface=interface))
|
||||
continue
|
||||
|
||||
# Skip if the interface is ib0
|
||||
if interface in ('ib0', 'ib1'):
|
||||
logging.debug('Skipping ib interface')
|
||||
continue
|
||||
|
||||
ip_addr = netifaces.ifaddresses(interface).get(netifaces.AF_INET, [])
|
||||
ip6_addr = netifaces.ifaddresses(interface).get(netifaces.AF_INET6, [])
|
||||
if config.network.ignore_ips:
|
||||
|
@ -341,7 +346,6 @@ class Network(object):
|
|||
'assigned_object_type': self.assigned_object_type,
|
||||
'assigned_object_id': interface.id
|
||||
}
|
||||
|
||||
netbox_ip = nb.ipam.ip_addresses.create(
|
||||
**query_params
|
||||
)
|
||||
|
@ -507,7 +511,7 @@ class Network(object):
|
|||
|
||||
class ServerNetwork(Network):
|
||||
def __init__(self, server, *args, **kwargs):
|
||||
super(ServerNetwork, self).__init__(server, args, kwargs)
|
||||
super(ServerNetwork, self).__init__(server, *args, **kwargs)
|
||||
|
||||
if config.network.ipmi:
|
||||
self.ipmi = self.get_ipmi()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue