Skip to content

Wrong type for "--count" arg #3

@bioex

Description

@bioex

The "--count" argument does not really work:

# python /var/tmp/bind-query-log-stats.py --count 10 /var/log/dns/query.log
Processing logfile /var/log/dns/query.log

<skip>

Top  ['10']  DNS names requested:
Traceback (most recent call last):
  File "/var/tmp/bind-query-log-stats.py", line 265, in <module>
    print_top_dns_requests(COUNT)
  File "/var/tmp/bind-query-log-stats.py", line 97, in print_top_dns_requests
    for query, _ in Counter(DNS_QUERIES).most_common(num_print):
  File "/usr/lib64/python2.7/collections.py", line 462, in most_common
    return _heapq.nlargest(n, self.iteritems(), key=_itemgetter(1))
  File "/usr/lib64/python2.7/heapq.py", line 465, in nlargest
    result = _nlargest(n, it)
TypeError: an integer is required

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions