munkireport_parser.py
def process_data(json_data, config):
    """Parse downloaded data and generate report"""
    mydata = json_data["data"]
    mydata.sort(key=sortfunc)

    computers = []

    for record in mydata:
        report = prepare_machine_report(record, config.get("excluded"))
        if report["should"]:
            report.pop("should", None)
            computers.append(report)

    print(yaml.dump(computers, allow_unicode=True, default_flow_style=False))
Parse downloaded data and generate report
Parse downloaded data and generate report
Parse downloaded data and generate report
def process_data(json_data, config):
    mydata = json_data["data"]
    mydata.sort(key=sortfunc)
    computers = []
    for record in mydata:
        report = prepare_machine_report(record, config.get("excluded"))
        if report["should"]:
            report.pop("should", None)
            computers.append(report)
    print(yaml.dump(computers, allow_unicode=True, default_flow_style=False))
def process_data ( json_data , config ) : mydata = json_data [ "data" ] mydata . sort ( key = sortfunc ) computers = [ ] for record in mydata : report = prepare_machine_report ( record , config . get ( "excluded" ) ) if report [ "should" ] : report . pop ( "should" , None ) computers . append ( report ) print ( yaml . dump ( computers , allow_unicode = True , default_flow_style = False ) )
Parse downloaded data and generate report
Parse downloaded data and generate report
"""Parse downloaded data and generate report"""
json_data
config