Пример #1
0
        configver = form.getvalue('configver')
        funct.logging(serv, "open old config %s" % configver)

        print("<h3>Config from %s, and version is: %s</h3>" %
              (serv, configver))
        print('<form action="configver.py#conf" method="get">')
        print('<input type="hidden" value="%s" name="serv">' % serv)
        print('<input type="hidden" value="%s" name="configver">' % configver)
        print('<input type="hidden" value="1" name="config">')
        print('<a name="conf"></a>')
        print(
            '<p class="accordion-expand-holder">'
            '<a class="accordion-expand-all ui-button ui-widget ui-corner-all" href="#">Expand all</a>'
            '</p></center>')
        funct.show_config(configver)
        print('<center><p>')
        funct.get_button("Just save", value="save")
        funct.get_button("Upload and restart")
        print('</p></form></center>')

if form.getvalue('serv') is not None and form.getvalue('config') is not None:
    configver = form.getvalue('configver')
    configver = hap_configs_dir + configver
    save = form.getvalue('save')

    funct.logging(serv, "configver.py upload old config %s" % configver)

    print("<center><b>Uploaded old config ver: %s </b></br></br></center>" %
          configver)
Пример #2
0
                                           'haproxy_save_configs_dir')

    if form.getvalue('configver') is None:
        cfg = hap_configs_dir + serv + "-" + funct.get_data('config') + ".cfg"
        funct.get_config(serv, cfg)
    else:
        cfg = hap_configs_dir + form.getvalue('configver')

    print("<center><h3>Config from %s</h3>" % serv)
    print(
        '<p class="accordion-expand-holder">'
        '<a class="accordion-expand-all ui-button ui-widget ui-corner-all" href="#">Expand all</a>'
        '</p>')
    print('</center>')

    funct.show_config(cfg)

    if form.getvalue('configver') is None:
        os.system("/bin/rm -f " + cfg)
    else:
        print('<br><center>')
        print('<form action="configver.py#conf" method="get">')
        print('<input type="hidden" value="%s" name="serv">' % serv)
        print('<input type="hidden" value="%s" name="configver">' %
              form.getvalue('configver'))
        print('<input type="hidden" value="1" name="config">')
        if form.getvalue('view') is None:
            funct.get_button("Just save", value="save")
            funct.get_button("Upload and restart")
        print('</form></center>')