git://git.onelab.eu
/
sfa.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
bug fix: here commit should be outside the if test
[sfa.git]
/
sfa
/
util
/
table.py
diff --git
a/sfa/util/table.py
b/sfa/util/table.py
index
bccda20
..
f6090a0
100644
(file)
--- a/
sfa/util/table.py
+++ b/
sfa/util/table.py
@@
-84,7
+84,9
@@
class SfaTable(list):
self.db.do(querystr)
for index in indexes:
self.db.do(index)
self.db.do(querystr)
for index in indexes:
self.db.do(index)
-
+
+ self.db.commit()
+
def remove(self, record):
query_str = "DELETE FROM %s WHERE record_id = %s" % \
(self.tablename, record['record_id'])
def remove(self, record):
query_str = "DELETE FROM %s WHERE record_id = %s" % \
(self.tablename, record['record_id'])
@@
-92,10
+94,11
@@
class SfaTable(list):
# if this is a site, remove all records where 'authority' == the
# site's hrn
# if this is a site, remove all records where 'authority' == the
# site's hrn
- if record['type'] == '
site
':
+ if record['type'] == '
authority
':
sql = " DELETE FROM %s WHERE authority = %s" % \
(self.tablename, record['hrn'])
sql = " DELETE FROM %s WHERE authority = %s" % \
(self.tablename, record['hrn'])
- self.db.do(sql)
+ self.db.do(sql)
+ self.db.commit()
def insert(self, record):
db_fields = self.db_fields(record)
def insert(self, record):
db_fields = self.db_fields(record)
@@
-180,9
+183,11
@@
class SfaTable(list):
def drop(self):
try:
self.db.do('DROP TABLE IF EXISTS ' + self.tablename)
def drop(self):
try:
self.db.do('DROP TABLE IF EXISTS ' + self.tablename)
+ self.db.commit()
except:
try:
self.db.do('DROP TABLE ' + self.tablename)
except:
try:
self.db.do('DROP TABLE ' + self.tablename)
+ self.db.commit()
except:
pass
except:
pass