diff --git a/app/sections.py b/app/sections.py index bac950ba..7402823a 100644 --- a/app/sections.py +++ b/app/sections.py @@ -2,7 +2,7 @@ import os import funct from jinja2 import Environment, FileSystemLoader -env = Environment(loader=FileSystemLoader('templates/'), autoescape=True,extensions=['jinja2.ext.loopcontrols']) +env = Environment(loader=FileSystemLoader('templates/'), autoescape=True, extensions=['jinja2.ext.loopcontrols']) template = env.get_template('sections.html') print('Content-type: text/html\n') @@ -22,7 +22,7 @@ end_line = "" try: user, user_id, role, token, servers = funct.get_users_params() -except: +except Exception: pass hap_configs_dir = funct.get_config_var('configs', 'haproxy_save_configs_dir') @@ -32,11 +32,11 @@ if serv is not None and open is not None: error = funct.get_config(serv, cfg) sections = funct.get_sections(cfg) -if serv is not None and section is not None : +if serv is not None and section is not None: try: funct.logging(serv, "sections.py open config") - except: + except Exception: pass start_line, end_line, config_read = funct.get_section_from_config(cfg, section) @@ -46,7 +46,7 @@ if serv is not None and section is not None : if serv is not None and form.getvalue('config') is not None: try: funct.logging(serv, "config.py edited config") - except: + except Exception: pass config = form.getvalue('config') @@ -71,23 +71,22 @@ if serv is not None and form.getvalue('config') is not None: os.system("/bin/rm -f " + hap_configs_dir + "*.old") -template = template.render(h2 = 1, title = "Working with HAProxy configs", - role = role, - action = "sections.py", - user = user, - select_id = "serv", - serv = serv, - aftersave = aftersave, - config = config_read, - cfg = cfg, - selects = servers, - stderr = stderr, - error = error, - start_line = start_line, - end_line = end_line, - section = section, - sections = sections, - note = 1, - versions = funct.versions(), - token = token) +template = template.render(h2=1, title="Working with HAProxy configs", + role=role, + action="sections.py", + user=user, + select_id="serv", + serv=serv, + aftersave=aftersave, + config=config_read, + cfg=cfg, + selects=servers, + stderr=stderr, + error=error, + start_line=start_line, + end_line=end_line, + section=section, + sections=sections, + versions=funct.versions(), + token=token) print(template) diff --git a/app/templates/config.html b/app/templates/config.html index 59d01cb6..586765d1 100644 --- a/app/templates/config.html +++ b/app/templates/config.html @@ -70,7 +70,7 @@
{% if note %} -Note:
+When reconfiguring the master server, the slave will be reconfigured automatically
+Unable to delete entire section
+