Fixed bugs
pull/19/head v1.4.1
Aidaho12 2018-01-26 10:26:02 +06:00
parent 06e8e65d85
commit 18c9f6b9c2
1 changed files with 5 additions and 9 deletions

View File

@ -23,8 +23,6 @@ path_config = "haproxy-webintarface.config"
config = configparser.ConfigParser()
config.read(path_config)
ssh_keys = config.get('ssh', 'ssh_keys')
ssh_user_name = config.get('ssh', 'ssh_user_name')
haproxy_configs_server = config.get('configs', 'haproxy_configs_server')
hap_configs_dir = config.get('configs', 'haproxy_save_configs_dir')
@ -35,12 +33,12 @@ if form.getvalue('serv') is not None and form.getvalue('open') is not None :
print('<form action="diff.py#diff" method="get">')
print('<center><h3><span style="padding: 75px;">Choose left</span><span style="padding: 100px;">Choose right</span></h3>')
print('<p><select autofocus required name="left">')
print('<p><select autofocus required name="left" id="left">')
print('<option disabled selected>Choose version</option>')
os.chdir(hap_configs_dir)
for files in glob.glob('*.cfg'):
for files in sorted(glob.glob('*.cfg')):
ip = files.split("-")
if serv == ip[0]:
if left == files:
@ -51,10 +49,10 @@ if form.getvalue('serv') is not None and form.getvalue('open') is not None :
print('</select>')
print('<select autofocus required name="right">')
print('<select autofocus required name="right" id="right">')
print('<option disabled selected>Choose version</option>')
for files in glob.glob('*.cfg'):
for files in sorted(glob.glob('*.cfg')):
ip = files.split("-")
if serv == ip[0]:
if right == files:
@ -66,13 +64,11 @@ if form.getvalue('serv') is not None and form.getvalue('open') is not None :
print('</select>')
print('<input type="hidden" value="%s" name="serv">' % serv)
print('<input type="hidden" value="open" name="open">')
print('<p><button type="submit" value="Compare" name="Compare">Compare</button></p></form>')
print('<p><button type="submit" value="Compare" name="Compare">Compare</button></p></form></center>')
if form.getvalue('serv') is not None and form.getvalue('right') is not None:
commands = [ 'diff -ub %s%s %s%s' % (hap_configs_dir, left, hap_configs_dir, right) ]
funct.ssh_command(haproxy_configs_server, commands, compare="compare")
print('<h3><a href="#top" title="UP">UP</a></center>')
funct.footer()