def __test_html():
    '''
    HTML generation test only used when called from the command line:
        python ./highstate.py
    Typical options for generating the report file:
    highstate:
        report_format: yaml
        report_delivery: file
        file_output: '/srv/salt/_returners/test.rpt'
    '''
    with salt.utils.files.fopen('test.rpt', 'r') as input_file:
        data_text = salt.utils.stringutils.to_unicode(input_file.read())
    data = salt.utils.yaml.safe_load(data_text)

    string_file = StringIO()
    _generate_html(data, string_file)
    string_file.seek(0)
    result = string_file.read()

    with salt.utils.files.fopen('test.html', 'w') as output:
        output.write(salt.utils.stringutils.to_str(result))
def __test_html ( ) : with salt . utils . files . fopen ( 'test.rpt' , 'r' ) as input_file : data_text = salt . utils . stringutils . to_unicode ( input_file . read ( ) ) data = salt . utils . yaml . safe_load ( data_text ) string_file = StringIO ( ) _generate_html ( data , string_file ) string_file . seek ( 0 ) result = string_file . read ( ) with salt . utils . files . fopen ( 'test.html' , 'w' ) as output : output . write ( salt . utils . stringutils . to_str ( result ) )
HTML generation test only used when called from the command line:
        python ./highstate.py
    Typical options for generating the report file:
    highstate:
        report_format: yaml
        report_delivery: file
        file_output: '/srv/salt/_returners/test.rpt'