Commit 04bdaacb authored by Rafael Monnerat's avatar Rafael Monnerat

slapos/collect: Get table list by quering the database.

parent 5f9de396
...@@ -36,8 +36,6 @@ from slapos.util import sqlite_connect ...@@ -36,8 +36,6 @@ from slapos.util import sqlite_connect
class Database: class Database:
database_name = "collector.db" database_name = "collector.db"
table_list = ["user", "computer", "system", "disk", \
"temperature", "heating"]
preserve_table_list = ["heating"] preserve_table_list = ["heating"]
CREATE_USER_TABLE = "create table if not exists user " \ CREATE_USER_TABLE = "create table if not exists user " \
...@@ -282,7 +280,7 @@ class Database: ...@@ -282,7 +280,7 @@ class Database:
delete_sql = "DELETE FROM %s WHERE %s" delete_sql = "DELETE FROM %s WHERE %s"
self.connect() self.connect()
for table in self.table_list: for table in self.getTableList():
if table not in self.preserve_table_list: if table not in self.preserve_table_list:
self._execute(delete_sql % (table, where_clause)) self._execute(delete_sql % (table, where_clause))
......
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