From e752f476b8bcbf02ba47079350263f0b6476ccef Mon Sep 17 00:00:00 2001 From: Sandrine Avakian Date: Thu, 11 Jul 2013 14:48:38 +0200 Subject: [PATCH] Removing useless prints and correcting attribute in api. --- sfa/iotlab/iotlabapi.py | 14 +++++++------- sfa/iotlab/iotlabpostgres.py | 2 -- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/sfa/iotlab/iotlabapi.py b/sfa/iotlab/iotlabapi.py index dd7300e6..82017a0e 100644 --- a/sfa/iotlab/iotlabapi.py +++ b/sfa/iotlab/iotlabapi.py @@ -793,8 +793,8 @@ class IotlabTestbedAPI(): logger.debug("IOTLABDRIVER \r\n \r\n \t AddLeases iotlab_ex_row %s" \ %(iotlab_ex_row)) - self.iotlab_db.iotlab_dbsession.add(iotlab_ex_row) - self.iotlab_db.iotlab_dbsession.commit() + self.iotlab_db.iotlab_session.add(iotlab_ex_row) + self.iotlab_db.iotlab_session.commit() logger.debug("IOTLABDRIVER \t AddLeases hostname_list start_time %s " \ %(start_time)) @@ -858,8 +858,8 @@ class IotlabTestbedAPI(): deleted_jobs = set_jobs_psql.difference(kept_jobs) deleted_jobs = list(deleted_jobs) if len(deleted_jobs) > 0: - self.iotlab_db.iotlab_dbsession.query(IotlabXP).filter(IotlabXP.job_id.in_(deleted_jobs)).delete(synchronize_session='fetch') - self.iotlab_db.iotlab_dbsession.commit() + self.iotlab_db.iotlab_session.query(IotlabXP).filter(IotlabXP.job_id.in_(deleted_jobs)).delete(synchronize_session='fetch') + self.iotlab_db.iotlab_session.commit() return @@ -890,7 +890,7 @@ class IotlabTestbedAPI(): #the same user in LDAP SA 27/07/12 job_oar_list = [] - jobs_psql_query = self.iotlab_db.iotlab_dbsession.query(IotlabXP).all() + jobs_psql_query = self.iotlab_db.iotlab_session.query(IotlabXP).all() jobs_psql_dict = dict([(row.job_id, row.__dict__ ) for row in jobs_psql_query ]) #jobs_psql_dict = jobs_psql_dict) logger.debug("IOTLABDRIVER \tGetLeases jobs_psql_dict %s"\ @@ -1018,8 +1018,8 @@ class IotlabTestbedAPI(): #""" ##new_row = FederatedToIotlab(iotlab_hrn, federated_hrn) - ##self.iotlab_db.iotlab_dbsession.add(new_row) - ##self.iotlab_db.iotlab_dbsession.commit() + ##self.iotlab_db.iotlab_session.add(new_row) + ##self.iotlab_db.iotlab_session.commit() #logger.debug("IOTLABDRIVER UpdatePerson EMPTY - DO NOTHING \r\n ") #return diff --git a/sfa/iotlab/iotlabpostgres.py b/sfa/iotlab/iotlabpostgres.py index 684ed106..154d9703 100644 --- a/sfa/iotlab/iotlabpostgres.py +++ b/sfa/iotlab/iotlabpostgres.py @@ -114,7 +114,6 @@ class IotlabDB(object): (config.SFA_DB_USER, config.SFA_DB_PASSWORD, config.SFA_DB_HOST, \ config.SFA_DB_PORT, IotlabDB._dbname) - print "URL", tcp_url , unix_url for url in [ unix_url, tcp_url ] : try: self.iotlab_engine = create_engine (url, echo_pool = @@ -147,7 +146,6 @@ class IotlabDB(object): if self.iotlab_session is None: Session = sessionmaker() self.iotlab_session = Session(bind = self.iotlab_engine) - print "\r\n \r\n \r\n OOOOOOOOOHHHHHHHHH YEEEEEEEEEEEEEAH" return self.iotlab_session def close_session(self): -- 2.43.0