Skip to content

Commit

Permalink
Merge pull request #208 from Solvik/fix/chriss/virtual_network_nic_ma…
Browse files Browse the repository at this point in the history
…c_addr

Fixed virtual network cards creation
  • Loading branch information
geektophe committed Mar 8, 2022
2 parents 18773a2 + 3b8917a commit b53dfa9
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions netbox_agent/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ def reset_vlan_on_interface(self, nic, interface):

def create_netbox_nic(self, nic, mgmt=False):
# TODO: add Optic Vendor, PN and Serial
type = self.get_netbox_type_for_nic(nic)
nic_type = self.get_netbox_type_for_nic(nic)
logging.info('Creating NIC {name} ({mac}) on {device}'.format(
name=nic['name'], mac=nic['mac'], device=self.device.name))

Expand All @@ -270,11 +270,10 @@ def create_netbox_nic(self, nic, mgmt=False):
params = dict(self.custom_arg)
params.update({
'name': nic['name'],
'type': type,
'type': nic_type,
'mgmt_only': mgmt,
})

if not nic.get('virtual', False):
if nic['mac']:
params['mac_address'] = nic['mac']

interface = self.nb_net.interfaces.create(**params)
Expand Down

0 comments on commit b53dfa9

Please sign in to comment.