|
|
@ -55,10 +55,10 @@ if serv is not None and form.getvalue('del') is not None:
|
|
|
|
env = Environment(loader=FileSystemLoader('templates/'))
|
|
|
|
env = Environment(loader=FileSystemLoader('templates/'))
|
|
|
|
template = env.get_template('delver.html')
|
|
|
|
template = env.get_template('delver.html')
|
|
|
|
for get in form:
|
|
|
|
for get in form:
|
|
|
|
if conf_format in get:
|
|
|
|
if conf_format in get and serv in get:
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
if form.getvalue('style') == 'new':
|
|
|
|
if form.getvalue('style') == 'new':
|
|
|
|
if sql.delete_config_version(form.getvalue('service'), form.getvalue(get)):
|
|
|
|
if sql.delete_config_version(service, form.getvalue(get)):
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
os.remove(form.getvalue(get))
|
|
|
|
os.remove(form.getvalue(get))
|
|
|
|
except OSError as e:
|
|
|
|
except OSError as e:
|
|
|
@ -86,7 +86,8 @@ if serv is not None and form.getvalue('config') is not None:
|
|
|
|
if service == 'keepalived':
|
|
|
|
if service == 'keepalived':
|
|
|
|
stderr = funct.upload_and_restart(serv, configver, just_save=save, keepalived=1)
|
|
|
|
stderr = funct.upload_and_restart(serv, configver, just_save=save, keepalived=1)
|
|
|
|
elif service == 'nginx':
|
|
|
|
elif service == 'nginx':
|
|
|
|
stderr = funct.master_slave_upload_and_restart(serv, configver, just_save=save, nginx=1)
|
|
|
|
config_file_name = sql.select_remote_path_from_version(server_ip=serv, service=service, local_path=configver)
|
|
|
|
|
|
|
|
stderr = funct.master_slave_upload_and_restart(serv, configver, just_save=save, nginx=1, config_file_name=config_file_name)
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
stderr = funct.master_slave_upload_and_restart(serv, configver, just_save=save)
|
|
|
|
stderr = funct.master_slave_upload_and_restart(serv, configver, just_save=save)
|
|
|
|
|
|
|
|
|
|
|
|