Pavel Loginov 5 years ago
parent
commit
8b2004d793
  1. 7
      app/create_db.py
  2. 2
      requirements.txt

7
app/create_db.py

@ -181,7 +181,7 @@ def update_db_v_31(**kwargs):
sql.append("INSERT INTO settings (param, value, section, `desc`) values('server_state_file', '/etc/haproxy/haproxy.state', 'haproxy', 'Path to HAProxy state file');")
sql.append("INSERT INTO settings (param, value, section, `desc`) values('haproxy_sock', '/var/run/haproxy.sock', 'haproxy', 'Path to HAProxy sock file');")
sql.append("INSERT INTO settings (param, value, section, `desc`) values('haproxy_sock_port', '1999', 'haproxy', 'HAProxy sock port');")
sql.append("INSERT INTO settings (param, value, section, `desc`) values('firewall_enable', '0', 'main', 'If enable this option Haproxy-wi will be configure firewalld based on config port');")
sql.append("INSERT INTO settings (param, value, section, `desc`) values('firewall_enable', '0', 'haproxy', 'If enable this option Haproxy-wi will be configure firewalld based on config port');")
sql.append("INSERT INTO settings (param, value, section, `desc`) values('apache_log_path', '/var/log/httpd/', 'logs', 'Path to Apache logs');")
sql.append("INSERT INTO settings (param, value, section, `desc`) values('ldap_enable', '0', 'ldap', 'If 1 ldap enabled');")
sql.append("INSERT INTO settings (param, value, section, `desc`) values('ldap_server', '', 'ldap', 'IP address ldap server');")
@ -441,12 +441,11 @@ def update_db_v_4_2_3(**kwargs):
except sqltool.Error as e:
if kwargs.get('silent') != 1:
if e.args[0] == 'duplicate column name: haproxy' or e == " 1060 (42S21): Duplicate column name 'haproxy' ":
print('DB was update to 4.2.3')
print('Updating... go to version 4.3.0')
else:
print("An error occurred:", e)
return False
else:
print("DB was update to 4.2.3")
return True
cur.close()
con.close()
@ -503,4 +502,4 @@ def update_all_silent():
if __name__ == "__main__":
create_table()
update_all()

2
requirements.txt

@ -7,5 +7,5 @@ networkx==2.1
matplotlib==2.1.2
future==0.13.1
mysql-connector-python==8.0.11
Jinja2>=2.10.1
jinja2>=2.10.1
bottle>=0.12.17
Loading…
Cancel
Save