- n = NIC(machine_id=None, mac_addr=randomMAC(), ip=ip, hostname=None)
- ctx.current.save(n)
- ctx.current.flush()
+ try:
+ n = database.NIC(machine=None, mac_addr=randomMAC(), ip=ip, hostname=None)
+ database.session.save(n)
+ database.session.flush()
+ except sqlalchemy.exceptions.IntegrityError:
+ pass