FreeBSD Bugzilla – Attachment 215810 Details for
Bug 247437
net-mgmt/flow-tools: Fails to run with Python 3.x
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Unuseful patch to flow-rptfmt
flow-rptfmt.patch (text/plain), 7.48 KB, created by
Andrew
on 2020-06-20 11:08:20 UTC
(
hide
)
Description:
Unuseful patch to flow-rptfmt
Filename:
MIME Type:
Creator:
Andrew
Created:
2020-06-20 11:08:20 UTC
Size:
7.48 KB
patch
obsolete
>--- flow-rptfmt.orig 2020-06-20 11:37:37.000000000 +0200 >+++ flow-rptfmt 2020-06-20 13:02:17.927923000 +0200 >@@ -110,49 +110,49 @@ > def _fmt_summary_detail(self): > > if self.got_totals: >- print "Ignores: %s" % self.field_vals['ignores'] >- print "Total Flows: %s" % self.field_vals['flows'] >- print "Total Octets: %s" % self.field_vals['octets'] >- print "Total Packets: %s" % self.field_vals['packets'] >- print "Total Duration (ms): %s" % self.field_vals['duration'] >- print "Real Time: %s" % self.field_vals['time_real'] >- print "Average Flow Time: %s" % self.field_vals['aflowtime'] >- print "Average Packets/Second: %s" % self.field_vals['aps'] >- print "Average Flows/Second: %s" % self.field_vals['afs'] >- print "Average Packets/Flow: %s" % self.field_vals['apf'] >- print "Flows/Second: %s" % self.field_vals['fps'] >- print "Flows/Second (real): %s" % self.field_vals['fps_real'] >+ print("Ignores: %s" % self.field_vals['ignores']) >+ print("Total Flows: %s" % self.field_vals['flows']) >+ print("Total Octets: %s" % self.field_vals['octets']) >+ print("Total Packets: %s" % self.field_vals['packets']) >+ print("Total Duration (ms): %s" % self.field_vals['duration']) >+ print("Real Time: %s" % self.field_vals['time_real']) >+ print("Average Flow Time: %s" % self.field_vals['aflowtime']) >+ print("Average Packets/Second: %s" % self.field_vals['aps']) >+ print("Average Flows/Second: %s" % self.field_vals['afs']) >+ print("Average Packets/Flow: %s" % self.field_vals['apf']) >+ print("Flows/Second: %s" % self.field_vals['fps']) >+ print("Flows/Second (real): %s" % self.field_vals['fps_real']) > >- print "\nAverage IP packet size distribution:" >- print "\n 1-32 64 96 128 160 192 224 256 288 320 352 384 416 448 480\n ", >+ print("\nAverage IP packet size distribution:") >+ print("\n 1-32 64 96 128 160 192 224 256 288 320 352 384 416 448 480\n ",) > for x in range(7,22): > print ("%-3.3f" % float(self.field_vals[x]))[1:], >- print "\n\n 512 544 576 1024 1536 2048 2560 3072 3584 4096 4608\n ", >+ print("\n\n 512 544 576 1024 1536 2048 2560 3072 3584 4096 4608\n ", end=" ") > for x in range(22,33): > print ("%-3.3f" % float(self.field_vals[x]))[1:], > >- print "\n\nPackets per flow distribution:" >- print "\n 1 2 4 8 12 16 20 24 28 32 36 40 44 48 52\n ", >+ print("\n\nPackets per flow distribution:") >+ print("\n 1 2 4 8 12 16 20 24 28 32 36 40 44 48 52\n ", end=" ") > for x in range(33,48): > print ("%-3.3f" % float(self.field_vals[x]))[1:], >- print "\n\n 60 100 200 300 400 500 600 700 800 900 >900\n ", >+ print("\n\n 60 100 200 300 400 500 600 700 800 900 >900\n ", end=" ") > for x in range(48,59): > print ("%-3.3f" % float(self.field_vals[x]))[1:], > >- print "\n\nOctets per flow distribution:" >- print "\n 32 64 128 256 512 1280 2048 2816 3584 4352 5120 5888 6656 7424 8192\n ", >+ print("\n\nOctets per flow distribution:") >+ print("\n 32 64 128 256 512 1280 2048 2816 3584 4352 5120 5888 6656 7424 8192\n ", end=" ") > for x in range(59,74): > print ("%-3.3f" % float(self.field_vals[x]))[1:], >- print "\n\n 8960 9728 10496 11264 12032 12800 13568 14336 15104 15872 >15872\n ", >+ print("\n\n 8960 9728 10496 11264 12032 12800 13568 14336 15104 15872 >15872\n ", end=" ") > print ("%-3.3f" % float(self.field_vals[74]))[1:], > for x in range(75,85): > print ("%-3.3f " % float(self.field_vals[x]))[1:], > >- print "\n\nFlow Time Distribution (ms):" >- print "\n 10 50 100 200 500 1000 2000 3000 4000 5000 6000 7000 8000 9000 10000\n ", >+ print("\n\nFlow Time Distribution (ms):") >+ print("\n 10 50 100 200 500 1000 2000 3000 4000 5000 6000 7000 8000 9000 10000\n ", end=" ") > for x in range(85,100): > print ("%-3.3f" % float(self.field_vals[x]))[1:], >- print "\n\n 12000 14000 16000 18000 20000 22000 24000 26000 28000 30000 >30000\n ", >+ print("\n\n 12000 14000 16000 18000 20000 22000 24000 26000 28000 30000 >30000\n ", end=" ") > for x in range(100,111): > print ("%-3.3f " % float(self.field_vals[x]))[1:], > print >@@ -172,7 +172,7 @@ > if self.field_display[y]: > # print "x=",x,"y=",y,"#" > i = self.field_avals[x][y] >- print i.ljust(self.field_lens[y]), >+ print(i.ljust(self.field_lens[y]), end=" ") > if line: > line = line - 1 > if not line: >@@ -194,9 +194,9 @@ > for i in self.header_info: > if i[0:7] == '# rec1:': > break >- print i; >+ print(i); > >- print "# ", sys.argv >+ print("# ", sys.argv) > > # summary-detail is a special format > if self.display_summary_detail != 1: >@@ -204,13 +204,13 @@ > if self.field_display[x]: > i = self.field_names[x] > l = self.field_lens[x] >- print i.ljust(l), >+ print(i.ljust(l), end=" ") > print > # > # > # > def fmt_ascii_footer(self) : >- print "\n", >+ print ("\n", end=" ") > > # > # HTML >@@ -220,20 +220,20 @@ > > if self.display_header: > >- print '''<pre>''' >+ print('''<pre>''') > for i in self.header_info: > if i[0:7] == '#rec1:': > break >- print i >- print '''</pre>''' >+ print(i) >+ print('''</pre>''') > >- print "<table border cellspacing=0 cellpadding=5>" >- print "<tr>" >+ print("<table border cellspacing=0 cellpadding=5>") >+ print("<tr>") > if self.display_summary_detail != 1: > for x in xrange(self.field_total): > if self.field_display[x]: >- print " <th>", self.field_names[x], '''</th>''' >- print '''</tr>''' >+ print(" <th>", self.field_names[x], '''</th>''') >+ print('''</tr>''') > > # > # >@@ -245,26 +245,26 @@ > line = int(self.max_lines) > > for x in self.field_iter: >- print "<tr>" >+ print("<tr>") > for y in xrange(self.field_total): > if self.field_display[y]: > i = self.field_avals[x][y] >- print " <td>", i, '''</td>''' >+ print(" <td>", i, '''</td>''') > if line: > line = line - 1 > if not line: > break >- print '''</tr>''' >+ print('''</tr>''') > > else: >- print '''<pre>''' >+ print('''<pre>''') > self._fmt_summary_detail() >- print '''</pre>''' >+ print('''</pre>''') > # > # > # > def fmt_html_footer(self) : >- print '''</table>''' >+ print('''</table>''') > > > # >@@ -515,13 +515,13 @@ > elif o == '-s': > opt_sort_field = v > elif o == '-h': >- print "Usage: flow-rptfmt [-hHnp] [-a alarm] [-f format] [-F display_fields]" >- print " [-m max_lines] [-s sort_field]" >+ print("Usage: flow-rptfmt [-hHnp] [-a alarm] [-f format] [-F display_fields]") >+ print(" [-m max_lines] [-s sort_field]") > sys.exit(0) > > > def sig_alarm(sig, stack): >- print "flow-rptfmt exceeded CPU time, consider running report offline." >+ print("flow-rptfmt exceeded CPU time, consider running report offline.") > sys.exit(0) > > signal.signal(signal.SIGALRM, sig_alarm) >@@ -541,5 +541,3 @@ > rpt.dump(opt_format, opt_display_header) > except IOError: > sys.exit(0)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
andrew.hotlab
:
maintainer-approval-
Actions:
View
|
Diff
Attachments on
bug 247437
:
215810
|
215815
|
215816