connected to %s " % serv)
+ except:
+ print("Connect fail")
sftp = ssh.open_sftp()
sftp.put(cfg, tmp_file)
sftp.close()
diff --git a/cgi-bin/options.py b/cgi-bin/options.py
index 200a91b8..7cdf4778 100644
--- a/cgi-bin/options.py
+++ b/cgi-bin/options.py
@@ -173,7 +173,11 @@ if serv is not None and act == "configShow":
if form.getvalue('viewlogs') is not None:
viewlog = form.getvalue('viewlogs')
log_path = config.get('main', 'log_path')
- log = open(log_path + viewlog, "r")
+ try:
+ log = open(log_path + viewlog, "r")
+ except IOError:
+ print('
Can\'t read import config file
')
+
print('
Shows log: %s
' % viewlog)
i = 0
for line in log:
diff --git a/cgi-bin/ovw.py b/cgi-bin/ovw.py
index 5236fc94..650fcfb7 100644
--- a/cgi-bin/ovw.py
+++ b/cgi-bin/ovw.py
@@ -131,7 +131,10 @@ def get_map(serv):
G = nx.DiGraph()
funct.get_config(serv, cfg)
- conf = open(cfg, "r")
+ try:
+ conf = open(cfg, "r")
+ except IOError:
+ print('
Can\'t read import config file
')
node = ""
line_new2 = [1,""]
@@ -159,7 +162,7 @@ def get_map(serv):
G.add_node(node,pos=(k,i),label_pos=(k,i+150))
if "server " in line or "use_backend" in line or "default_backend" in line and "stats" not in line:
- if "timeout" not in line and "default-server" not in line and "#use_backend" not in line and "stats" not in line:
+ if "timeout" not in line and "default-server" not in line and "#" not in line and "stats" not in line:
i = i - 300
j = j + 1
if "check" in line:
@@ -203,7 +206,7 @@ def get_map(serv):
plt.savefig("map.png")
plt.show()
except Exception as e:
- print("!!! There was an issue, " + str(e))
+ print('