Commit 38d58738 authored by Penom Nom's avatar Penom Nom

update_storage_size updated

parent dcfbde12
...@@ -37,7 +37,12 @@ def update_storage_size(savedir, host, user, passwd, db): ...@@ -37,7 +37,12 @@ def update_storage_size(savedir, host, user, passwd, db):
res = curs.fetchall() res = curs.fetchall()
update_list = [] update_list = []
for data in res : for data in res :
update_list.append((get_storage_size( savedir + data[1] ), data[0]) ) try :
size = get_storage_size( savedir + data[1] )
update_list.append((size, data[0]) )
except:
e = sys.exc_info()[0]
print "Error while updating {0} : {1}" .format(savedir + data[1] , e)
curs.executemany( "UPDATE " + tablename + " SET storage_size='%s' WHERE uid= %s ", update_list ) curs.executemany( "UPDATE " + tablename + " SET storage_size='%s' WHERE uid= %s ", update_list )
conn.commit() conn.commit()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment