haproxy-wi/app/update_db.py

16 lines
337 B
Python
Raw Normal View History

2018-04-24 07:38:48 +00:00
#!/usr/bin/env python3
# -*- coding: utf-8 -*-"
import create_db
import funct
2018-04-24 07:38:48 +00:00
mysql_enable = funct.get_config_var('mysql', 'enable')
2018-04-24 07:38:48 +00:00
if mysql_enable == '1':
from mysql.connector import errorcode
import mysql.connector as sqltool
else:
db = "haproxy-wi.db"
import sqlite3 as sqltool
2018-04-28 07:34:45 +00:00
create_db.create_table()
2018-04-24 07:38:48 +00:00
create_db.update_all()