Browse Source

v7.1.0.0

Changelog: https://roxy-wi.org/changelog#7.1.0
pull/372/head
Aidaho 11 months ago
parent
commit
d619497ab2
  1. 1
      app/jobs.py
  2. 2
      app/modules/db/sql.py
  3. 6
      app/modules/service/ha_cluster.py
  4. 2
      app/modules/service/installation.py
  5. 4
      app/modules/service/keepalived.py
  6. 1
      app/routes/ha/routes.py
  7. 3
      app/routes/install/routes.py
  8. 2
      config_other/requirements_el7.txt
  9. 2
      config_other/requirements_el8.txt
  10. 2
      config_other/requirements_el9.txt
  11. 2
      requirements.txt

1
app/jobs.py

@ -93,4 +93,3 @@ def delete_ansible_artifacts():
shutil.rmtree(f'{ansible_path}/{folder}')
except Exception as e:
raise Exception(f'error: Cron cannot delete ansible folders: {e}')

2
app/modules/db/sql.py

@ -4509,7 +4509,7 @@ def update_ha_virt_ip(vip_id: int, vip: str) -> None:
def delete_ha_virt(vip_id: int) -> None:
try:
Server.delete().where(Server.server_id == HaClusterVirt.get(HaClusterVirt.vip_id == vip_id).virt_id).execute()
except Exception as e:
except Exception:
pass

6
app/modules/service/ha_cluster.py

@ -14,7 +14,7 @@ def create_cluster(cluster: object, group_id: int) -> str:
try:
cluster_id = sql.create_cluster(cluster['name'], syn_flood, group_id, cluster['desc'])
roxywi_common.logging(cluster_id, f'New cluster has been created', keep_history=1, roxywi=1, service='HA cluster')
roxywi_common.logging(cluster_id, 'New cluster has been created', keep_history=1, roxywi=1, service='HA cluster')
except Exception as e:
return f'error: Cannot create new HA cluster: {e}'
@ -115,13 +115,13 @@ def delete_cluster(cluster_id: int) -> str:
slaves = sql.select_cluster_slaves(cluster_id)
for slave in slaves:
slave_ip = select_server_ip_by_id(slave.server_id)
slave_ip = sql.select_server_ip_by_id(slave.server_id)
try:
sql.update_server_master(0, slave_ip)
except Exception as e:
raise Exception(f'error: Cannot update master on slave {slave_ip}: {e}')
roxywi_common.logging(cluster_id, f'Cluster {cluster_name} has been deleted', keep_history=1, roxywi=1, service='HA cluster')
roxywi_common.logging(cluster_id, f'Cluster has been deleted', keep_history=1, roxywi=1, service='HA cluster')
return 'ok'

2
app/modules/service/installation.py

@ -185,7 +185,7 @@ def grafana_install():
def generate_kp_inv(json_data: json, install_service) -> object:
json_data = json.loads(json_data)
inv = {"server": {"hosts":{}}}
inv = {"server": {"hosts": {}}}
server_ips = []
cluster_id = int(json_data['cluster_id'])
haproxy = json_data['services']['haproxy']['enabled']

4
app/modules/service/keepalived.py

@ -13,8 +13,8 @@ def get_status(server_ip: str) -> tuple:
for k in out.split():
out1.append(k)
h = (out1,)
servers_with_status1= h
servers_with_status2= h
servers_with_status1 = h
servers_with_status2 = h
except Exception:
servers_with_status1 = h
servers_with_status2 = h

1
app/routes/ha/routes.py

@ -3,7 +3,6 @@ import json
from flask import render_template, g, request, jsonify
from flask_login import login_required
from app import app
from app.routes.ha import bp
from middleware import get_user_params, check_services
import modules.db.sql as sql

3
app/routes/install/routes.py

@ -1,4 +1,4 @@
from flask import render_template, request, g, abort
from flask import render_template, request, g
from flask_login import login_required
from app.routes.install import bp
@ -6,7 +6,6 @@ from middleware import get_user_params, check_services
import app.modules.db.sql as sql
import app.modules.common.common as common
import app.modules.roxywi.auth as roxywi_auth
import app.modules.roxywi.common as roxywi_common
import app.modules.server.server as server_mod
import app.modules.service.common as service_common
import app.modules.service.installation as service_mod

2
config_other/requirements_el7.txt

@ -17,4 +17,4 @@ python3-nmap<=1.5.1
aio-pika>=7.1.0
pika>=1.2.0
websockets>=9.0
ansible-runner==2.3.2
ansible-runner==2.3.1

2
config_other/requirements_el8.txt

@ -18,4 +18,4 @@ python3-nmap<=1.5.1
aio-pika>=7.1.0
pika>=1.2.0
websockets>=9.0
ansible-runner==2.3.2
ansible-runner==2.3.1

2
config_other/requirements_el9.txt

@ -18,4 +18,4 @@ aio-pika>=7.1.0
pika>=1.2.0
websockets>=9.0
tzlocal==2.0.0
ansible-runner==2.3.2
ansible-runner==2.3.1

2
requirements.txt

@ -21,4 +21,4 @@ Flask==2.2.5
Flask-Login==0.6.2
Flask-APScheduler==1.13.0
Flask-Caching==2.1.0
ansible-runner==2.3.2
ansible-runner==2.3.1

Loading…
Cancel
Save