make sure to update IPMI interface when mac changed (#32)

This commit is contained in:
Solvik 2019-08-12 17:21:46 +02:00 committed by GitHub
parent ff04eb0905
commit 955579df0d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -221,7 +221,9 @@ class Network():
update = False
self.create_or_update_netbox_ip_on_interface(address, interface)
update, interface = self.reset_vlan_on_interface(nic['vlan'], interface)
if mac != interface.mac_address:
if mac.upper() != interface.mac_address:
logging.info('IPMI mac changed from {old_mac} to {new_mac}'.format(
old_mac=interface.mac_address, new_mac=mac.upper()))
interface.mac_address = mac
update = True
if update: