def run(self, pcap):
        """
        Runs snort against the supplied pcap.

        :param pcap: Filepath to pcap file to scan
        :returns: tuple of version, list of alerts
        """
        proc = Popen(self._snort_cmd(pcap), stdout=PIPE,
                     stderr=PIPE, universal_newlines=True)
        stdout, stderr = proc.communicate()
        if proc.returncode != 0:
            raise Exception("\n".join(["Execution failed return code: {0}" \
                                .format(proc.returncode), stderr or ""]))

        return (parse_version(stderr),
                [ x for x in parse_alert(stdout) ])
def run ( self , pcap ) : proc = Popen ( self . _snort_cmd ( pcap ) , stdout = PIPE , stderr = PIPE , universal_newlines = True ) stdout , stderr = proc . communicate ( ) if proc . returncode != 0 : raise Exception ( "\n" . join ( [ "Execution failed return code: {0}" . format ( proc . returncode ) , stderr or "" ] ) ) return ( parse_version ( stderr ) , [ x for x in parse_alert ( stdout ) ] )
Runs snort against the supplied pcap.

        :param pcap: Filepath to pcap file to scan
        :returns: tuple of version, list of alerts