From: Evan Broder Date: Mon, 20 Oct 2008 23:08:33 +0000 (-0400) Subject: Switch xen-ips to using the new SQLAlchemy API X-Git-Tag: sipb-xen-www/3.17~6 X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-web.git/commitdiff_plain/7c8f43b416a8910eda4af95c7f66e410b95ce5b7?ds=sidebyside Switch xen-ips to using the new SQLAlchemy API I swear I've written this code 3 different times now. Not sure why it's only now getting committed svn path=/trunk/packages/sipb-xen-www/; revision=1156 --- diff --git a/code/xen-ips b/code/xen-ips index 0af6956..58f3078 100755 --- a/code/xen-ips +++ b/code/xen-ips @@ -37,9 +37,9 @@ def usage(): print >> sys.stderr, "USAGE: " + sys.argv[0] + " " 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__':