print >> sys.stderr, "USAGE: " + sys.argv[0] + " <ip>"
def addip(ip):
- n = database.NIC(machine_id=None, mac_addr=randomMAC(), ip=ip, hostname=None)
- database.ctx.current.save(n)
- database.ctx.current.flush()
+ n = database.NIC(machine=None, mac_addr=randomMAC(), ip=ip, hostname=None)
+ database.session.save(n)
+ database.session.flush()
if __name__ == '__main__':