tag 857973 patch
thanks

On 16/03 07:48, James Cowgill wrote:
> When running the testsuite, the ntp dstat plugin tries to get the time
> using NTP from 0.fedora.pool.ntp.org. As policy says, accessing the
> network in this way is not permitted for packages in the main archive.

Fixed by excluding ntp from --all-plugins. NMU diff attached.
diff -Nru dstat-0.7.3/debian/changelog dstat-0.7.3/debian/changelog
--- dstat-0.7.3/debian/changelog	2017-01-18 11:12:16.000000000 +0100
+++ dstat-0.7.3/debian/changelog	2019-02-23 02:10:18.000000000 +0100
@@ -1,3 +1,11 @@
+dstat (0.7.3-1.1) unstable; urgency=high
+
+  * Non-maintainer upload
+  * Fix crash in top-int plugin (closes: #852927)
+  * Exclude ntp plugin from --all-plugins, used by make test (closes: #857973)
+
+ -- Emanuele Rocca <e...@debian.org>  Sat, 23 Feb 2019 02:10:18 +0100
+
 dstat (0.7.3-1) unstable; urgency=medium
 
   * New upstream release (closes: #851494)
diff -Nru dstat-0.7.3/debian/patches/all_plugins_exclude_ntp_857973 dstat-0.7.3/debian/patches/all_plugins_exclude_ntp_857973
--- dstat-0.7.3/debian/patches/all_plugins_exclude_ntp_857973	1970-01-01 01:00:00.000000000 +0100
+++ dstat-0.7.3/debian/patches/all_plugins_exclude_ntp_857973	2019-02-23 02:10:18.000000000 +0100
@@ -0,0 +1,20 @@
+Description: exclude ntp from --all-plugins
+ dstat allows to specify --all-plugins, a CLI option used by `make test` for
+ testing purposes. Exclude the ntp plugin from the list as it performs network
+ access.
+Author: Emanuele Rocca <e...@debian.org>
+Bug-Debian: https://bugs.debian.org/857973
+Last-Update: 2019-02-23
+
+--- dstat-0.7.3.orig/dstat
++++ dstat-0.7.3/dstat
+@@ -177,6 +177,9 @@ class Options:
+                 ### Make list unique in a fancy fast way
+                 plugins = {}.fromkeys(allplugins).keys()
+                 plugins.sort()
++                # Do not include ntp plugin as it performs network access. See
++                # https://bugs.debian.org/857973
++                plugins.remove('ntp')
+                 self.plugins += plugins
+             elif opt in ['--bits']:
+                 self.bits = True
diff -Nru dstat-0.7.3/debian/patches/series dstat-0.7.3/debian/patches/series
--- dstat-0.7.3/debian/patches/series	2014-03-24 03:02:19.000000000 +0100
+++ dstat-0.7.3/debian/patches/series	2019-02-23 02:10:18.000000000 +0100
@@ -1 +1,3 @@
 fix_629680
+top_int_plugin_852927
+all_plugins_exclude_ntp_857973
diff -Nru dstat-0.7.3/debian/patches/top_int_plugin_852927 dstat-0.7.3/debian/patches/top_int_plugin_852927
--- dstat-0.7.3/debian/patches/top_int_plugin_852927	1970-01-01 01:00:00.000000000 +0100
+++ dstat-0.7.3/debian/patches/top_int_plugin_852927	2019-02-23 02:08:28.000000000 +0100
@@ -0,0 +1,21 @@
+Description: avoid crashing in top-int plugin
+ The first intset can have less elements than the second one. Catch IndexError
+ to avoid crashing if that is the case.
+Author: Emanuele Rocca <e...@debian.org>
+Bug-Debian: https://bugs.debian.org/852927
+Last-Update: 2019-02-23
+
+--- dstat-0.7.3.orig/plugins/dstat_top_int.py
++++ dstat-0.7.3/plugins/dstat_top_int.py
+@@ -37,7 +37,10 @@ class dstat_plugin(dstat):
+                 self.intset2 = [ long(int) for int in line[3:] ]
+ 
+         for i in range(len(self.intset2)):
+-            total = (self.intset2[i] - self.intset1[i]) * 1.0 / elapsed
++            try:
++                total = (self.intset2[i] - self.intset1[i]) * 1.0 / elapsed
++            except IndexError:
++                continue
+ 
+             ### Put the highest value in self.val
+             if total > self.val['total']:

Reply via email to