From 97f578131315deb14accdc6398ee12737b16c358 Mon Sep 17 00:00:00 2001 From: Aidaho12 Date: Fri, 27 Apr 2018 10:42:20 +0600 Subject: [PATCH] v2.0.8 Firewalld suppoty --- cgi-bin/funct.py | 14 ++++++++------ inc/style.css | 7 ++++++- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/cgi-bin/funct.py b/cgi-bin/funct.py index e0dce844..af766769 100644 --- a/cgi-bin/funct.py +++ b/cgi-bin/funct.py @@ -397,10 +397,13 @@ def upload_and_restart(serv, cfg, **kwargs): commands = [ "/sbin/haproxy -q -c -f " + tmp_file, "mv -f " + tmp_file + " " + haproxy_config_path ] else: commands = [ "/sbin/haproxy -q -c -f " + tmp_file, "mv -f " + tmp_file + " " + haproxy_config_path, restart_command ] - - if config.get('haproxy', 'firewall_enable') == "1": - commands.extend(open_port_firewalld(cfg)) - + + try: + if config.get('haproxy', 'firewall_enable') == "1": + commands.extend(open_port_firewalld(cfg)) + except: + print('
Please check the config for the presence of the parameter - "firewall_enable". Mast be: "0" or "1". Firewalld configure not working now
') + i = 0 for command in commands: i = i + 1 @@ -409,8 +412,7 @@ def upload_and_restart(serv, cfg, **kwargs): if not stderr.read(): print('
Config ok
')
 			else:
-				print('
In your config have errors, please check, and try again
') - print(stderr.read().decode(encoding='UTF-8')) + print('
In your config have errors, please check, and try again


') return False break if i is not 1: diff --git a/inc/style.css b/inc/style.css index 3b35671b..a422c257 100644 --- a/inc/style.css +++ b/inc/style.css @@ -530,7 +530,7 @@ a:focus { padding-left: 10px; margin-bottom: 10px; } -.alert-danger, .alert-info, .alert-success { +.alert-danger, .alert-info, .alert-success, .alert-warning { width: 400px; margin-left: 15px; } @@ -554,6 +554,11 @@ a:focus { background-color: #d1ecf1; border-color: #bee5eb; } +.alert-warning { + color: #856404; + background-color: #fff3cd; + border-color: #ffeeba; +} label { display: inline-block; max-width: 100%;