X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sfa%2Fplanetlab%2Fplslices.py;h=9231d7ad16c33b63bc29d7e5e2d78f2949b03f57;hb=b54e90d0c3868fa5afb89ff784cba0d5d36265ad;hp=4d23ff2d225f2021a1a075104235f763424cd1cc;hpb=5246a6bcb681854188f5953011aa6181a6032f35;p=sfa.git diff --git a/sfa/planetlab/plslices.py b/sfa/planetlab/plslices.py index 4d23ff2d..9231d7ad 100644 --- a/sfa/planetlab/plslices.py +++ b/sfa/planetlab/plslices.py @@ -10,7 +10,6 @@ from sfa.planetlab.vlink import VLink from sfa.planetlab.topology import Topology from sfa.planetlab.plxrn import PlXrn, hrn_to_pl_slicename, xrn_to_hostname, top_auth, hash_loginbase from sfa.storage.model import SliverAllocation -from sfa.storage.alchemy import dbsession MAXINT = 2L**31-1 @@ -272,7 +271,7 @@ class PlSlices: component_id=component_id, slice_urn = slice_urn, allocation_state='geni_allocated') - record.sync() + record.sync(self.driver.api.dbsession()) return resulting_nodes def free_egre_key(self): @@ -452,7 +451,7 @@ class PlSlices: else: slice = slice_exists[0] #Update expiration if necessary - if slice['expires'] != expires: + if slice.get('expires', None) != expires: self.driver.shell.UpdateSlice( int(slice['slice_id']), {'expires' : expires}) return self.driver.shell.GetSlices(int(slice['slice_id']))[0] @@ -510,11 +509,12 @@ class PlSlices: 'first_name': person_hrn, 'last_name': person_hrn, 'email': users_by_hrn[person_hrn].get('email', "%s@geni.net"%person_hrn.split('.')[-1]), - 'enabled': True } person_id = self.driver.shell.AddPerson(person) self.driver.shell.AddRoleToPerson('user', int(person_id)) + # enable the account + self.driver.shell.UpdatePerson(int(person_id), {'enabled': True}) self.driver.shell.SetPersonHrn(int(person_id), person_hrn) self.driver.shell.SetPersonSfaCreated(int(person_id), 'True') self.driver.shell.AddPersonToSite(int(person_id), site['site_id'])