def pcap_analysis(self, pcap_path, pretty=False):
    """Pcap analysis task.

    :param pcap_path: Path to pcap.
    :param pretty: Output json indentation.
    """
    self.update_state(meta={'filename': os.path.basename(pcap_path)})

    pcap = AnalyzedPcap(pcap_path)
    analyzer = NetworkAnalyzer(None, pcap.path, None)
    analyzer.analyze_pcap()

    output_file = f'{storage_path}/{self.request.id}/report.json'

    output = pcap.output
    output['network_analysis'] = analyzer.output

    save_output(output, output_file, pretty)

    return 'pcap'
Pcap analysis task.

    :param pcap_path: Path to pcap.
    :param pretty: Output json indentation.
    
lisa/web_api/tasks.py