git://git.onelab.eu
/
sfa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0a4f0ce
)
Fixing mistake in db name.
author
Sandrine Avakian
<sandrine.avakian@inria.fr>
Thu, 17 Oct 2013 13:34:35 +0000
(15:34 +0200)
committer
Mohamed Larabi
<mohamed.larabi@inria.fr>
Wed, 23 Oct 2013 13:12:32 +0000
(15:12 +0200)
sfa/iotlab/iotlabpostgres.py
patch
|
blob
|
history
diff --git
a/sfa/iotlab/iotlabpostgres.py
b/sfa/iotlab/iotlabpostgres.py
index
d454cbf
..
34b2662
100644
(file)
--- a/
sfa/iotlab/iotlabpostgres.py
+++ b/
sfa/iotlab/iotlabpostgres.py
@@
-23,19
+23,19
@@
slice_table = {'record_id_user': 'integer PRIMARY KEY references X ON DELETE \
'record_id_slice': 'integer', 'slice_hrn': 'text NOT NULL'}
#Dict with all the specific iotlab tables
'record_id_slice': 'integer', 'slice_hrn': 'text NOT NULL'}
#Dict with all the specific iotlab tables
-# tablenames_dict = {'
testbed_xp
': slice_table}
+# tablenames_dict = {'
lease_table
': slice_table}
TestbedBase = declarative_base()
TestbedBase = declarative_base()
-class
Testbed
XP (TestbedBase):
+class
LeaseTable
XP (TestbedBase):
""" SQL alchemy class to manipulate the rows of the slice_iotlab table in
lease_table database. Handles the records representation and creates the
table if it does not exist yet.
"""
""" SQL alchemy class to manipulate the rows of the slice_iotlab table in
lease_table database. Handles the records representation and creates the
table if it does not exist yet.
"""
- __tablename__ = '
testbed_xp
'
+ __tablename__ = '
lease_table
'
slice_hrn = Column(String)
experiment_id = Column(Integer, primary_key=True)
slice_hrn = Column(String)
experiment_id = Column(Integer, primary_key=True)
@@
-56,7
+56,7
@@
class TestbedXP (TestbedBase):
"""Prints the SQLAlchemy record to the format defined
by the function.
"""
"""Prints the SQLAlchemy record to the format defined
by the function.
"""
- result = "<
testbed_xp
: slice_hrn = %s , experiment_id %s end_time = %s" \
+ result = "<
lease_table
: slice_hrn = %s , experiment_id %s end_time = %s" \
% (self.slice_hrn, self.experiment_id, self.end_time)
result += ">"
return result
% (self.slice_hrn, self.experiment_id, self.end_time)
result += ">"
return result
@@
-69,7
+69,7
@@
class TestbedAdditionalSfaDB(object):
# Stores the unique Singleton instance-
_connection_singleton = None
# defines the database name
# Stores the unique Singleton instance-
_connection_singleton = None
# defines the database name
- dbname = "
lease_table
"
+ dbname = "
testbed_xp
"
class Singleton:
"""
class Singleton:
"""
@@
-204,7
+204,7
@@
class TestbedAdditionalSfaDB(object):
kept_experiments)
deleted_experiments = list(deleted_experiments)
if len(deleted_experiments) > 0:
kept_experiments)
deleted_experiments = list(deleted_experiments)
if len(deleted_experiments) > 0:
- self.testbed_session.query(
TestbedXP).filter(Testbed
XP.job_id.in_(deleted_experiments)).delete(synchronize_session='fetch')
+ self.testbed_session.query(
LeaseTableXP).filter(LeaseTable
XP.job_id.in_(deleted_experiments)).delete(synchronize_session='fetch')
self.testbed_session.commit()
return
self.testbed_session.commit()
return