Bug 251054 - net-mgmt/flow-tools: errors with Python 3.7
Summary: net-mgmt/flow-tools: errors with Python 3.7
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Muhammad Moinur Rahman
URL:
Keywords: buildisok
Depends on:
Blocks:
 
Reported: 2020-11-11 16:42 UTC by Andrew
Modified: 2020-11-26 00:16 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (bofh)


Attachments
patch-flow-log2rrd (264 bytes, patch)
2020-11-11 18:01 UTC, Volodymyr Pushkar
no flags Details | Diff
patch-flow-rpt2rrd (2.44 KB, patch)
2020-11-11 18:01 UTC, Volodymyr Pushkar
no flags Details | Diff
patch-flow-rptfmt (1.99 KB, patch)
2020-11-11 18:02 UTC, Volodymyr Pushkar
no flags Details | Diff
Patch for the port maintainer (6.76 KB, patch)
2020-11-11 18:24 UTC, Andrew
andrew.hotlab: maintainer-approval?
andrew.hotlab: maintainer-approval? (bofh)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew 2020-11-11 16:42:49 UTC
After transition from python 2.7 to 3.7, flow-report(1) seems to have some issues... for example:

# flow-cat ft-v05.2020-06-19.000001+0200 | flow-report 
Traceback (most recent call last):
  File "/usr/local/bin/flow-rptfmt", line 533, in <module>
    rpt.load(sys.stdin, opt_sort_field, opt_max_lines, opt_percent)
  File "/usr/local/bin/flow-rptfmt", line 297, in load
    splt = string.split(line2,',')
AttributeError: module 'string' has no attribute 'split'
flow-report: pclose(flow-rptfmt -f ascii): failed exit code=1.

Another example:

# flow-cat ft-v05.2020-06-19.000001+0200 | flow-report -v TYPE=ip-destination-address/ip-destination-port -v SORT=+octets -v OPTIONS=-header
Traceback (most recent call last):
  File "/usr/local/bin/flow-rptfmt", line 533, in <module>
    rpt.load(sys.stdin, opt_sort_field, opt_max_lines, opt_percent)
  File "/usr/local/bin/flow-rptfmt", line 324, in load
    for i in string.split(line[8:],','):
AttributeError: module 'string' has no attribute 'split'
flow-report: pclose(flow-rptfmt -f ascii): failed exit code=1.


As asked in bug #249388, comment #6, here is the content of /usr/local/etc/cfg/stat.cfg:

stat-report default
  type @{TYPE:-summary-detail}
  output
    format ascii
    sort @{SORT:-+}
    fields @{FIELDS:-+}
    options @{OPTIONS:-+header,+xheader,+totals}
    path |flow-rptfmt @{RPTOPT:--f ascii}

stat-definition default
  report default
Comment 1 Volodymyr Pushkar 2020-11-11 18:01:19 UTC
Created attachment 219567 [details]
patch-flow-log2rrd
Comment 2 Volodymyr Pushkar 2020-11-11 18:01:47 UTC
Created attachment 219568 [details]
patch-flow-rpt2rrd
Comment 3 Volodymyr Pushkar 2020-11-11 18:02:07 UTC
Created attachment 219569 [details]
patch-flow-rptfmt
Comment 4 Volodymyr Pushkar 2020-11-11 18:03:39 UTC
I attached patches for this port, please try it out. Looking for port update.
Comment 5 Andrew 2020-11-11 18:24:30 UTC
Created attachment 219570 [details]
Patch for the port maintainer

(In reply to Volodymyr Pushkar from comment #4)

Wonderful, thank you Vlad: I just tested them and they look like working for me!

I merged them all in this patch for port's maintainer.
Comment 6 Automation User 2020-11-26 00:16:27 UTC
Build and package info is available at https://gitlab.com/swills/freebsd-ports/pipelines/221374697