[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#927348: unblock: salt/2018.3.4+dfsg1-2



Hi Paul,

Am Dienstag, den 14.05.2019, 20:13 +0200 schrieb Paul Gevers:
> Hi Benjamin,
> 
> On 14-05-2019 13:13, Benjamin Drung wrote:
> > Hi Paul,
> > 
> > Am Freitag, den 10.05.2019, 20:40 +0200 schrieb Paul Gevers:
> > > Control: tags -1 moreinfo
> > > 
> > > So, all in all, I don't want to unblock the new upstream with
> > > your
> > > packaging, we're too late in the cycle and the version really
> > > doesn't
> > > match the freeze policy. However, I am offering you an upload
> > > based
> > > on the version currently in buster via t-p-u. If you go that
> > > route,
> > > please only fix bugs 919849, 928337, 922352, 924763, the
> > > LC_ALL=C.UTF-8 item and the systemd issue. Please fix 919849
> > > without
> > > switching your build to sphinxdoc, that isn't appropriate at this
> > > moment.
> > 
> > Okay. So you prefer an upload to t-p-u or can I just revert those
> > rejected changes (typos fixes and using dh_sphinxdoc) and do
> > another
> > upload to unstable?
> 
> I would prefer an upload to unstable if you also revert to the
> previous
> upstream tar ball (e.g. using the +really version syntax).

I prepared the relevant changes in the master-proposed branch:
https://salsa.debian.org/salt-team/salt/commits/master-proposed

Attached a diff between 2018.3.4~git20180207+dfsg1-1 from testing and
the proposed 2018.3.4+dfsg1-6 created with:

git diff debian/2018.3.4_git20180207+dfsg1-1..master-proposed -- debian

I tested this proposed version that it builds and that the
documentation works as expected (including the search) and that all
needed files are there and that it contains to broken symlinks.

While testing I found and fixed another instance of privacy breach:
https://salsa.debian.org/salt-team/salt/commit/08a00aaa4670d0713ec55c0d23d25e64ad85e624
(privacy breach is not part of the policy yet, see #726998)
Let me know if this change is acceptable or not.

I would like to upload that proposed version to unstable. If you
insists of staying with the 2018.3.4~git20180207+dfsg1 snapshot, I will
rebase this patch on top of 2018.3.4~git20180207+dfsg1 and prepare the
upload for t-p-u.

-- 
Benjamin Drung
System Developer
Debian & Ubuntu Developer

1&1 IONOS Cloud GmbH | Greifswalder Str. 207 | 10405 Berlin | Germany
E-mail: benjamin.drung@cloud.ionos.com | Web: www.ionos.de

Head Office: Berlin, Germany
District Court Berlin Charlottenburg, Registration number: HRB 125506 B
Executive Management: Christoph Steffens, Matthias Steinberg, Achim
Weiss

Member of United Internet
diff --git a/debian/changelog b/debian/changelog
index e1942d9d..9d0dfca3 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,65 @@
+salt (2018.3.4+dfsg1-6) unstable; urgency=medium
+
+  * Revert changes that were rejected by the release team:
+    - Drop fixing various spelling mistakes
+    - Drop using jquery.js from sphinx
+    - Drop using dh_sphinxdoc
+    - Drop patch to set script type explicitly to text/javascript
+  * doc: Use local Open Sans fonts instead of querying Google
+    to fix possible privacy breach
+
+ -- Benjamin Drung <benjamin.drung@cloud.ionos.com>  Fri, 24 May 2019 15:01:45 +0200
+
+salt (2018.3.4+dfsg1-5) unstable; urgency=medium
+
+  * Cherry-pick upstream patch to fix edge case when minion ID is a
+    16-character string (Closes: #928337)
+
+ -- Benjamin Drung <benjamin.drung@cloud.ionos.com>  Thu, 02 May 2019 13:23:44 +0200
+
+salt (2018.3.4+dfsg1-4) unstable; urgency=medium
+
+  * Cherry-pick upstream patch to fix retrieving systemd version (for 241-3)
+
+ -- Benjamin Drung <benjamin.drung@cloud.ionos.com>  Fri, 26 Apr 2019 16:38:39 +0200
+
+salt (2018.3.4+dfsg1-3) unstable; urgency=medium
+
+  [ Benjamin Drung ]
+  * tests: Drop copying missing templates directory
+  * salt-doc: Install favicon in document root and do not compress it
+  * salt-doc: Fix JavaScript symlinks to bootstrap (Closes: #919849)
+  * doc: Set script type explicitly to text/javascript
+  * Use jquery.js from sphinx
+  * Symlink vendor JavaScript files before building
+  * Use dh_sphinxdoc
+
+  [ Steffen Kockel ]
+  * doc: Fix logo link to point to contents.html
+  * doc: Ensure searchtools.js gets included (to fix the search)
+
+ -- Benjamin Drung <benjamin.drung@cloud.ionos.com>  Thu, 25 Apr 2019 13:39:10 +0200
+
+salt (2018.3.4+dfsg1-2) unstable; urgency=medium
+
+  * Fix test_xen_virtual on kernels with no Xen support (Closes: #922352)
+  * Expose tornado4 as tornado for zmq.eventloop.ioloop (Closes: #924763)
+
+ -- Benjamin Drung <benjamin.drung@cloud.ionos.com>  Wed, 17 Apr 2019 20:26:11 +0200
+
+salt (2018.3.4+dfsg1-1) unstable; urgency=medium
+
+  * New upstream release.
+  * Refresh patches
+  * Fix various spelling mistakes
+  * Drop NOTICE from salt-common (the upstream tarball does not contain it)
+  * Skip SampleConfTest and ExtendTestCase if the required sample conf or
+    templates directories are missing
+  * Run tests with LC_ALL=C.UTF-8
+  * Remove unused minified documentation CSS files
+
+ -- Benjamin Drung <benjamin.drung@cloud.ionos.com>  Fri, 05 Apr 2019 13:58:40 +0200
+
 salt (2018.3.4~git20180207+dfsg1-1) unstable; urgency=medium
 
   * New upstream pre-release snapshot.
diff --git a/debian/control b/debian/control
index 2ad29fc3..659c7b61 100644
--- a/debian/control
+++ b/debian/control
@@ -219,7 +219,8 @@ Description: remote manager to administer servers via Salt SSH
 Package: salt-doc
 Architecture: all
 Section: doc
-Depends: libjs-bootstrap,
+Depends: fonts-open-sans,
+         libjs-bootstrap,
          libjs-jquery,
          libjs-modernizr,
          libjs-sphinxdoc,
diff --git a/debian/patches/0001-Skip-SampleConfTest-if-sample-conf-directories-are-m.patch b/debian/patches/0001-Skip-SampleConfTest-if-sample-conf-directories-are-m.patch
new file mode 100644
index 00000000..3ed6d187
--- /dev/null
+++ b/debian/patches/0001-Skip-SampleConfTest-if-sample-conf-directories-are-m.patch
@@ -0,0 +1,97 @@
+From 0473683aceaba9a975fc28f72ff80e8ab12dea2d Mon Sep 17 00:00:00 2001
+From: Benjamin Drung <benjamin.drung@cloud.ionos.com>
+Date: Wed, 3 Apr 2019 14:50:12 +0200
+Subject: [PATCH 1/2] Skip SampleConfTest if sample conf directories are
+ missing
+
+The release tarball does not contain `conf/cloud.profiles.d`,
+`conf/cloud.providers.d`, and `conf/cloud.maps.d`. Therefore the test
+cases will fail:
+
+```
+======================================================================
+ERROR: test_conf_cloud_maps_d_files_are_commented (unit.test_config.SampleConfTest)
+[CPU:0.0%|MEM:53.9%]
+----------------------------------------------------------------------
+Traceback (most recent call last):
+  File "tests/unit/test_config.py", line 236, in test_conf_cloud_maps_d_files_are_commented
+    cloud_sample_files = os.listdir(SAMPLE_CONF_DIR + 'cloud.maps.d/')
+FileNotFoundError: [Errno 2] No such file or directory: 'conf/cloud.maps.d/'
+
+======================================================================
+ERROR: test_conf_cloud_profiles_d_files_are_commented (unit.test_config.SampleConfTest)
+[CPU:0.0%|MEM:53.9%]
+----------------------------------------------------------------------
+Traceback (most recent call last):
+  File "tests/unit/test_config.py", line 200, in test_conf_cloud_profiles_d_files_are_commented
+    cloud_sample_files = os.listdir(SAMPLE_CONF_DIR + 'cloud.profiles.d/')
+FileNotFoundError: [Errno 2] No such file or directory: 'conf/cloud.profiles.d/'
+
+======================================================================
+ERROR: test_conf_cloud_providers_d_files_are_commented (unit.test_config.SampleConfTest)
+[CPU:0.0%|MEM:53.9%]
+----------------------------------------------------------------------
+Traceback (most recent call last):
+  File "tests/unit/test_config.py", line 218, in test_conf_cloud_providers_d_files_are_commented
+    cloud_sample_files = os.listdir(SAMPLE_CONF_DIR + 'cloud.providers.d/')
+FileNotFoundError: [Errno 2] No such file or directory: 'conf/cloud.providers.d/'
+```
+
+Forwarded: https://github.com/saltstack/salt/pull/52403
+Signed-off-by: Benjamin Drung <benjamin.drung@cloud.ionos.com>
+---
+ tests/unit/test_config.py | 21 +++++++++++++++------
+ 1 file changed, 15 insertions(+), 6 deletions(-)
+
+diff --git a/tests/unit/test_config.py b/tests/unit/test_config.py
+index 740e086cf7..69b8aefb72 100644
+--- a/tests/unit/test_config.py
++++ b/tests/unit/test_config.py
+@@ -197,9 +197,12 @@ class SampleConfTest(TestCase):
+         commented out. This test loops through all of the files in that directory to check
+         for any lines that are not commented or blank.
+         '''
+-        cloud_sample_files = os.listdir(SAMPLE_CONF_DIR + 'cloud.profiles.d/')
++        cloud_sample_dir = SAMPLE_CONF_DIR + 'cloud.profiles.d/'
++        if not os.path.exists(cloud_sample_dir):
++            self.skipTest("Sample config directory '{}' is missing.".format(cloud_sample_dir))
++        cloud_sample_files = os.listdir(cloud_sample_dir)
+         for conf_file in cloud_sample_files:
+-            profile_conf = SAMPLE_CONF_DIR + 'cloud.profiles.d/' + conf_file
++            profile_conf = cloud_sample_dir + conf_file
+             ret = salt.config._read_conf_file(profile_conf)
+             self.assertEqual(
+                 ret,
+@@ -215,9 +218,12 @@ class SampleConfTest(TestCase):
+         commented out. This test loops through all of the files in that directory to check
+         for any lines that are not commented or blank.
+         '''
+-        cloud_sample_files = os.listdir(SAMPLE_CONF_DIR + 'cloud.providers.d/')
++        cloud_sample_dir = SAMPLE_CONF_DIR + 'cloud.providers.d/'
++        if not os.path.exists(cloud_sample_dir):
++            self.skipTest("Sample config directory '{}' is missing.".format(cloud_sample_dir))
++        cloud_sample_files = os.listdir(cloud_sample_dir)
+         for conf_file in cloud_sample_files:
+-            provider_conf = SAMPLE_CONF_DIR + 'cloud.providers.d/' + conf_file
++            provider_conf = cloud_sample_dir + conf_file
+             ret = salt.config._read_conf_file(provider_conf)
+             self.assertEqual(
+                 ret,
+@@ -233,9 +239,12 @@ class SampleConfTest(TestCase):
+         commented out. This test loops through all of the files in that directory to check
+         for any lines that are not commented or blank.
+         '''
+-        cloud_sample_files = os.listdir(SAMPLE_CONF_DIR + 'cloud.maps.d/')
++        cloud_sample_dir = SAMPLE_CONF_DIR + 'cloud.maps.d/'
++        if not os.path.exists(cloud_sample_dir):
++            self.skipTest("Sample config directory '{}' is missing.".format(cloud_sample_dir))
++        cloud_sample_files = os.listdir(cloud_sample_dir)
+         for conf_file in cloud_sample_files:
+-            map_conf = SAMPLE_CONF_DIR + 'cloud.maps.d/' + conf_file
++            map_conf = cloud_sample_dir + conf_file
+             ret = salt.config._read_conf_file(map_conf)
+             self.assertEqual(
+                 ret,
+-- 
+2.17.1
+
diff --git a/debian/patches/0002-Explicitly-import-attributes-from-tornado.patch b/debian/patches/0002-Explicitly-import-attributes-from-tornado.patch
index 33683c02..b26cd85d 100644
--- a/debian/patches/0002-Explicitly-import-attributes-from-tornado.patch
+++ b/debian/patches/0002-Explicitly-import-attributes-from-tornado.patch
@@ -1046,7 +1046,7 @@ index 1a9ab10bfa..f6f95ee60d 100644
  import weakref
  from datetime import datetime
  
-@@ -2659,7 +2659,7 @@ class GitFS(GitBase):
+@@ -2672,7 +2672,7 @@ class GitFS(GitBase):
          exited.
          '''
          # No need to get the ioloop reference if we're not initializing remotes
@@ -1314,7 +1314,7 @@ index f889e4cedb..6ef680b1b9 100644
              mock_opts["process_count_max"] = process_count_max
  
 -            io_loop = tornado.ioloop.IOLoop()
-+            io_loop =  IOLoop()
++            io_loop = IOLoop()
              minion = salt.minion.Minion(mock_opts, jid_queue=[], io_loop=io_loop)
              try:
  
@@ -1327,25 +1327,25 @@ index f889e4cedb..6ef680b1b9 100644
  
                  # up until process_count_max: gen.sleep does not get called, processes are started normally
                  for i in range(process_count_max):
-@@ -241,7 +243,7 @@ class MinionTestCase(TestCase, AdaptedConfigurationTestCaseMixin):
+@@ -242,7 +244,7 @@ class MinionTestCase(TestCase, AdaptedConfigurationTestCaseMixin):
                  patch('salt.utils.process.SignalHandlingMultiprocessingProcess.join', MagicMock(return_value=True)):
              mock_opts = self.get_config('minion', from_scratch=True)
              mock_opts['beacons_before_connect'] = True
 -            io_loop = tornado.ioloop.IOLoop()
-+            io_loop =  IOLoop()
++            io_loop = IOLoop()
              io_loop.make_current()
              minion = salt.minion.Minion(mock_opts, io_loop=io_loop)
              try:
-@@ -267,7 +269,7 @@ class MinionTestCase(TestCase, AdaptedConfigurationTestCaseMixin):
+@@ -269,7 +271,7 @@ class MinionTestCase(TestCase, AdaptedConfigurationTestCaseMixin):
                  patch('salt.utils.process.SignalHandlingMultiprocessingProcess.join', MagicMock(return_value=True)):
              mock_opts = self.get_config('minion', from_scratch=True)
              mock_opts['scheduler_before_connect'] = True
 -            io_loop = tornado.ioloop.IOLoop()
-+            io_loop =  IOLoop()
++            io_loop = IOLoop()
              io_loop.make_current()
              minion = salt.minion.Minion(mock_opts, io_loop=io_loop)
              try:
-@@ -295,7 +297,7 @@ class MinionTestCase(TestCase, AdaptedConfigurationTestCaseMixin):
+@@ -297,7 +299,7 @@ class MinionTestCase(TestCase, AdaptedConfigurationTestCaseMixin):
  
  
  @skipIf(NO_MOCK, NO_MOCK_REASON)
diff --git a/debian/patches/0002-Skip-ExtendTestCase-if-templates-directory-is-missin.patch b/debian/patches/0002-Skip-ExtendTestCase-if-templates-directory-is-missin.patch
new file mode 100644
index 00000000..114f8064
--- /dev/null
+++ b/debian/patches/0002-Skip-ExtendTestCase-if-templates-directory-is-missin.patch
@@ -0,0 +1,54 @@
+From e74f78fca666e730f48f24082e4824b67af7eb9f Mon Sep 17 00:00:00 2001
+From: Benjamin Drung <benjamin.drung@cloud.ionos.com>
+Date: Wed, 3 Apr 2019 15:04:20 +0200
+Subject: [PATCH 2/2] Skip ExtendTestCase if templates directory is missing
+
+The release tarball does not contain the `templates` directory.
+Therefore `ExtendTestCase` will fail:
+
+```
+======================================================================
+ERROR: test_run (unit.utils.test_extend.ExtendTestCase)
+[CPU:0.0%|MEM:53.9%]
+----------------------------------------------------------------------
+Traceback (most recent call last):
+  File "tests/unit/utils/test_extend.py", line 40, in test_run
+    out = salt.utils.extend.run('test', 'test', 'this description', integration.CODE_DIR, False)
+  File "salt/utils/extend.py", line 242, in run
+    MODULE_OPTIONS = _fetch_templates(os.path.join(salt_dir, 'templates'))
+  File "salt/utils/extend.py", line 76, in _fetch_templates
+    for item in os.listdir(src):
+FileNotFoundError: [Errno 2] No such file or directory: ' templates'
+```
+
+Forwarded: https://github.com/saltstack/salt/pull/52403
+Signed-off-by: Benjamin Drung <benjamin.drung@cloud.ionos.com>
+---
+ tests/unit/utils/test_extend.py | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/tests/unit/utils/test_extend.py b/tests/unit/utils/test_extend.py
+index 2cf90fcaaf..9cbb767ca5 100644
+--- a/tests/unit/utils/test_extend.py
++++ b/tests/unit/utils/test_extend.py
+@@ -14,7 +14,7 @@ import shutil
+ from datetime import date
+ 
+ # Import Salt Testing libs
+-from tests.support.unit import TestCase
++from tests.support.unit import TestCase, skipIf
+ from tests.support.mock import MagicMock, patch
+ 
+ # Import salt libs
+@@ -35,6 +35,8 @@ class ExtendTestCase(TestCase):
+                 shutil.rmtree(self.out, True)
+         os.chdir(self.starting_dir)
+ 
++    @skipIf(not os.path.exists(os.path.join(integration.CODE_DIR, 'templates')),
++            "Test template directory 'templates/' missing.")
+     def test_run(self):
+         with patch('sys.exit', MagicMock):
+             out = salt.utils.extend.run('test', 'test', 'this description', integration.CODE_DIR, False)
+-- 
+2.17.1
+
diff --git a/debian/patches/0003-Use-renamed-python3-tornado4.patch b/debian/patches/0003-Use-renamed-python3-tornado4.patch
index 270fc469..01ad3154 100644
--- a/debian/patches/0003-Use-renamed-python3-tornado4.patch
+++ b/debian/patches/0003-Use-renamed-python3-tornado4.patch
@@ -21,7 +21,7 @@ Subject: [PATCH 3/3] Use renamed python3-tornado4
  salt/transport/ipc.py                         | 23 +++++++++++-----
  salt/transport/mixins/auth.py                 |  5 +++-
  salt/transport/tcp.py                         | 26 +++++++++++++------
- salt/transport/zeromq.py                      | 11 +++++---
+ salt/transport/zeromq.py                      | 20 +++++++++-----
  salt/utils/asynchronous.py                    |  8 ++++--
  salt/utils/event.py                           |  8 ++++--
  salt/utils/gitfs.py                           |  5 +++-
@@ -41,11 +41,11 @@ Subject: [PATCH 3/3] Use renamed python3-tornado4
  tests/unit/test_minion.py                     | 18 +++++++++----
  tests/unit/transport/test_ipc.py              | 11 +++++---
  tests/unit/transport/test_tcp.py              | 14 +++++++---
- tests/unit/transport/test_zeromq.py           |  8 ++++--
+ tests/unit/transport/test_zeromq.py           | 13 ++++++++--
  tests/unit/utils/test_asynchronous.py         | 11 +++++---
  tests/unit/utils/test_context.py              | 11 +++++---
  tests/unit/utils/test_event.py                |  5 +++-
- 41 files changed, 303 insertions(+), 104 deletions(-)
+ 41 files changed, 314 insertions(+), 107 deletions(-)
 
 diff --git a/doc/conf.py b/doc/conf.py
 index 23d3442c16..720026b823 100644
@@ -454,7 +454,17 @@ diff --git a/salt/transport/zeromq.py b/salt/transport/zeromq.py
 index 999197ba3a..cd1588e1cc 100644
 --- a/salt/transport/zeromq.py
 +++ b/salt/transport/zeromq.py
-@@ -47,9 +47,14 @@ except ImportError:
+@@ -36,9 +36,6 @@ from salt.exceptions import SaltReqTimeoutError
+ from salt._compat import ipaddress
+ 
+ from salt.utils.zeromq import zmq, ZMQDefaultLoop, install_zmq, ZMQ_VERSION_INFO, LIBZMQ_VERSION_INFO
+-import zmq.error
+-import zmq.eventloop.ioloop
+-import zmq.eventloop.zmqstream
+ 
+ try:
+     import zmq.utils.monitor
+@@ -47,9 +44,20 @@ except ImportError:
      HAS_ZMQ_MONITOR = False
  
  # Import Tornado Libs
@@ -465,10 +475,16 @@ index 999197ba3a..cd1588e1cc 100644
 +    import tornado4
 +    import tornado4.gen as tornado_gen
 +    from tornado4.concurrent import Future as TornadoFuture
++    # Expose tornado4 as tornado for zmq.eventloop.ioloop
++    sys.modules['tornado'] = tornado4
 +except ImportError:
 +    import tornado
 +    import tornado.gen as tornado_gen
 +    from tornado.concurrent import Future as TornadoFuture
++
++import zmq.error
++import zmq.eventloop.ioloop
++import zmq.eventloop.zmqstream
  
  # Import third party libs
  try:
@@ -603,7 +619,7 @@ diff --git a/salt/version.py b/salt/version.py
 index 715a9eb43e..6a247ceb8b 100644
 --- a/salt/version.py
 +++ b/salt/version.py
-@@ -584,7 +584,7 @@ def dependency_information(include_salt_cloud=False):
+@@ -590,7 +590,7 @@ def dependency_information(include_salt_cloud=False):
          ('RAET', 'raet', '__version__'),
          ('ZMQ', 'zmq', 'zmq_version'),
          ('Mako', 'mako', '__version__'),
@@ -612,7 +628,7 @@ index 715a9eb43e..6a247ceb8b 100644
          ('timelib', 'timelib', 'version'),
          ('dateutil', 'dateutil', '__version__'),
          ('pygit2', 'pygit2', '__version__'),
-@@ -610,7 +610,13 @@ def dependency_information(include_salt_cloud=False):
+@@ -616,7 +616,13 @@ def dependency_information(include_salt_cloud=False):
              yield name, attr
              continue
          try:
@@ -685,8 +701,8 @@ diff --git a/tests/integration/modules/test_ssh.py b/tests/integration/modules/t
 index 493c5de8ab..20cb5c3eda 100644
 --- a/tests/integration/modules/test_ssh.py
 +++ b/tests/integration/modules/test_ssh.py
-@@ -17,7 +17,10 @@ from tests.support.helpers import skip_if_binaries_missing
- import salt.utils.files
+@@ -18,7 +18,10 @@ from tests.support.helpers import skip_if_binaries_missing
+ import salt.utils.platform
  
  # Import 3rd-party libs
 -from tornado.httpclient import HTTPClient
@@ -863,21 +879,30 @@ index 84546128d5..8a9e2dac31 100644
  import salt.config
  from salt.ext import six
 diff --git a/tests/unit/transport/test_zeromq.py b/tests/unit/transport/test_zeromq.py
-index 798ab0c6c6..4af9cd4547 100644
+index 798ab0c6c6..3846c30cb3 100644
 --- a/tests/unit/transport/test_zeromq.py
 +++ b/tests/unit/transport/test_zeromq.py
-@@ -23,8 +23,12 @@ import zmq.eventloop.ioloop
- # support pyzmq 13.0.x, TODO: remove once we force people to 14.0.x
- if not hasattr(zmq.eventloop.ioloop, 'ZMQIOLoop'):
-     zmq.eventloop.ioloop.ZMQIOLoop = zmq.eventloop.ioloop.IOLoop
--from tornado.testing import AsyncTestCase
--import tornado.gen as tornado_gen
+@@ -19,12 +19,21 @@ except ImportError:
+     from distro import linux_distribution
+ 
+ # Import 3rd-party libs
 +try:
++    import tornado4
 +    from tornado4.testing import AsyncTestCase
 +    import tornado4.gen as tornado_gen
++    # Expose tornado4 as tornado for zmq.eventloop.ioloop
++    import sys
++    sys.modules['tornado'] = tornado4
 +except ImportError:
 +    from tornado.testing import AsyncTestCase
 +    import tornado.gen as tornado_gen
++
+ import zmq.eventloop.ioloop
+ # support pyzmq 13.0.x, TODO: remove once we force people to 14.0.x
+ if not hasattr(zmq.eventloop.ioloop, 'ZMQIOLoop'):
+     zmq.eventloop.ioloop.ZMQIOLoop = zmq.eventloop.ioloop.IOLoop
+-from tornado.testing import AsyncTestCase
+-import tornado.gen as tornado_gen
  
  # Import Salt libs
  import salt.config
diff --git a/debian/patches/Fix-edge-case-when-minion-ID-is-a-16-character-string.patch b/debian/patches/Fix-edge-case-when-minion-ID-is-a-16-character-string.patch
new file mode 100644
index 00000000..62ed3546
--- /dev/null
+++ b/debian/patches/Fix-edge-case-when-minion-ID-is-a-16-character-string.patch
@@ -0,0 +1,68 @@
+From 1fcb0ff2641f6ed61a95ee55008c8059367ed167 Mon Sep 17 00:00:00 2001
+From: Erik Johnson <palehose@gmail.com>
+Date: Wed, 23 Jan 2019 14:21:52 -0600
+Subject: [PATCH] Fix edge case when minion ID is a 16-character string
+
+Some code in salt._compat which checks if the value is a packed binary
+representation of an IPv6 address fails if the value passed is not a
+bytestring (i.e. a `unicode` type on PY2 or `str` type on PY3). This
+fixes that code when the minion ID is a 16-character string (not a
+bytestring). Note that the minion ID will never be a bytestring as of
+2018.3.0, so this affects any 16-character minion ID when the minion ID
+is checked to see if it is really an IP address.
+
+Closes: #928337
+Origin: upstream, https://github.com/saltstack/salt/pull/51931
+---
+ salt/_compat.py                  | 9 +--------
+ tests/unit/utils/test_network.py | 9 +++++++++
+ 2 files changed, 10 insertions(+), 8 deletions(-)
+
+diff --git a/salt/_compat.py b/salt/_compat.py
+index 8d38f38230..3d208bae0b 100644
+--- a/salt/_compat.py
++++ b/salt/_compat.py
+@@ -189,7 +182,7 @@ class IPv6AddressScoped(ipaddress.IPv6Address):
+         :return:
+         '''
+         packed = False
+-        if len(data) == 16 and ':' not in data:
++        if isinstance(data, bytes) and len(data) == 16 and b':' not in data:
+             try:
+                 packed = bool(int(str(bytearray(data)).encode('hex'), 16))
+             except ValueError:
+diff --git a/tests/unit/utils/test_network.py b/tests/unit/utils/test_network.py
+index cc785a655b..6a691fe0d4 100644
+--- a/tests/unit/utils/test_network.py
++++ b/tests/unit/utils/test_network.py
+@@ -185,11 +185,17 @@ class NetworkTestCase(TestCase):
+     def test_is_ip(self):
+         self.assertTrue(network.is_ip('10.10.0.3'))
+         self.assertFalse(network.is_ip('0.9.800.1000'))
++        # Check 16-char-long unicode string
++        # https://github.com/saltstack/salt/issues/51258
++        self.assertFalse(network.is_ipv6('sixteen-char-str'))
+ 
+     def test_is_ipv4(self):
+         self.assertTrue(network.is_ipv4('10.10.0.3'))
+         self.assertFalse(network.is_ipv4('10.100.1'))
+         self.assertFalse(network.is_ipv4('2001:db8:0:1:1:1:1:1'))
++        # Check 16-char-long unicode string
++        # https://github.com/saltstack/salt/issues/51258
++        self.assertFalse(network.is_ipv4('sixteen-char-str'))
+ 
+     def test_is_ipv6(self):
+         self.assertTrue(network.is_ipv6('2001:db8:0:1:1:1:1:1'))
+@@ -202,6 +208,9 @@ class NetworkTestCase(TestCase):
+         self.assertFalse(network.is_ipv6('2001:0db8:::0370:7334'))
+         self.assertFalse(network.is_ipv6('10.0.1.2'))
+         self.assertFalse(network.is_ipv6('2001.0db8.85a3.0000.0000.8a2e.0370.7334'))
++        # Check 16-char-long unicode string
++        # https://github.com/saltstack/salt/issues/51258
++        self.assertFalse(network.is_ipv6('sixteen-char-str'))
+ 
+     def test_parse_host_port(self):
+         _ip = ipaddress.ip_address
+-- 
+2.20.1
+
diff --git a/debian/patches/Fix-retrieve-systemd-version-using-regex.patch b/debian/patches/Fix-retrieve-systemd-version-using-regex.patch
new file mode 100644
index 00000000..61ad9490
--- /dev/null
+++ b/debian/patches/Fix-retrieve-systemd-version-using-regex.patch
@@ -0,0 +1,38 @@
+From 94809d0a179958ef251ea38daea46c86821166d3 Mon Sep 17 00:00:00 2001
+From: Jordan Jacobelli <jordan@cri.epita.fr>
+Date: Sat, 2 Mar 2019 15:46:23 +0100
+Subject: [PATCH] Fix retrieve systemd version using regex
+
+Fixes #51745
+
+Signed-off-by: Jordan Jacobelli <jordan@cri.epita.fr>
+---
+ salt/utils/systemd.py | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/salt/utils/systemd.py b/salt/utils/systemd.py
+index 7790b3567d..060bc1e3fb 100644
+--- a/salt/utils/systemd.py
++++ b/salt/utils/systemd.py
+@@ -6,6 +6,7 @@ Contains systemd related help files
+ from __future__ import absolute_import, print_function, unicode_literals
+ import logging
+ import os
++import re
+ import subprocess
+ 
+ # Import Salt libs
+@@ -65,8 +66,8 @@ def version(context=None):
+         stdout=subprocess.PIPE, stderr=subprocess.STDOUT).communicate()[0]
+     outstr = salt.utils.stringutils.to_str(stdout)
+     try:
+-        ret = int(outstr.splitlines()[0].split()[-1])
+-    except (IndexError, ValueError):
++        ret = int(re.search(r'\w+ ([0-9]+)', outstr.splitlines()[0]).group(1))
++    except (AttributeError, IndexError, ValueError):
+         log.error(
+             'Unable to determine systemd version from systemctl '
+             '--version, output follows:\n%s', outstr
+-- 
+2.20.1
+
diff --git a/debian/patches/Fix-test_xen_virtual-on-kernels-with-no-Xen-support.patch b/debian/patches/Fix-test_xen_virtual-on-kernels-with-no-Xen-support.patch
new file mode 100644
index 00000000..95e362cf
--- /dev/null
+++ b/debian/patches/Fix-test_xen_virtual-on-kernels-with-no-Xen-support.patch
@@ -0,0 +1,69 @@
+From fb6eb4d0575adba07cb22efa862366cdb3e523ea Mon Sep 17 00:00:00 2001
+From: Benjamin Drung <benjamin.drung@cloud.ionos.com>
+Date: Wed, 17 Apr 2019 17:18:01 +0200
+Subject: [PATCH] Fix test_xen_virtual on kernels with no Xen support
+
+The latest version of salt is failing its autopkgtests on ppc64el and s390x
+architectures in Ubuntu:
+
+```
+[...]
+FAIL: test_xen_virtual (unit.grains.test_core.CoreGrainsTestCase)
+[CPU:0.0%|MEM:53.3%]
+----------------------------------------------------------------------
+Traceback (most recent call last):
+  File "tests/unit/grains/test_core.py", line 701, in test_xen_virtual
+    'Xen PV DomU'
+AssertionError: None != 'Xen PV DomU'
+
+----------------------------------------------------------------------
+Ran 7575 tests in 3249.235s
+[...]
+```
+
+  (http://autopkgtest.ubuntu.com/packages/s/salt/disco/ppc64el)
+
+The cause of this failure is an improper test which mocks up an isfile check
+for /sys/bus/xen/drivers/xenconsole, but which doesn't also mock up the
+check for the /sys/bus/xen directory; so if run on a kernel with no Xen
+support at all, the test will fail.
+
+The test happens to pass on the other architectures on which Ubuntu runs
+autopkgtests, because these happen to be architectures which have Xen
+support and Xen happens to be enabled in the kernels on these architectures.
+But it's a bad test that depends on the kernel instead of actually unit
+testing the code.
+
+Therefore also mock `os.path.isdir` to return `True` for the path
+`/sys/bus/xen`.
+
+Bug-Debian: https://bugs.debian.org/922352
+Forwarded: https://github.com/saltstack/salt/pull/52582
+Signed-off-by: Benjamin Drung <benjamin.drung@cloud.ionos.com>
+---
+ tests/unit/grains/test_core.py | 9 ++++-----
+ 1 file changed, 4 insertions(+), 5 deletions(-)
+
+diff --git a/tests/unit/grains/test_core.py b/tests/unit/grains/test_core.py
+index b2f784b14f..6dbeb42a75 100644
+--- a/tests/unit/grains/test_core.py
++++ b/tests/unit/grains/test_core.py
+@@ -690,11 +690,10 @@ class CoreGrainsTestCase(TestCase, LoaderModuleMockMixin):
+         '''
+         Test if OS grains are parsed correctly in Ubuntu Xenial Xerus
+         '''
+-        with patch.object(os.path, 'isfile', MagicMock(return_value=False)):
+-            with patch.dict(core.__salt__, {'cmd.run': MagicMock(return_value='')}), \
+-                patch.object(os.path,
+-                             'isfile',
+-                             MagicMock(side_effect=lambda x: True if x == '/sys/bus/xen/drivers/xenconsole' else False)):
++        with patch.multiple(os.path, isdir=MagicMock(side_effect=lambda x: x == '/sys/bus/xen'),
++                            isfile=MagicMock(side_effect=lambda x:
++                                             x == '/sys/bus/xen/drivers/xenconsole')):
++            with patch.dict(core.__salt__, {'cmd.run': MagicMock(return_value='')}):
+                 log.debug('Testing Xen')
+                 self.assertEqual(
+                     core._virtual({'kernel': 'Linux'}).get('virtual_subtype'),
+-- 
+2.20.1
+
diff --git a/debian/patches/Skip-test_module_name_source_match.patch b/debian/patches/Skip-test_module_name_source_match.patch
index 952c5e70..902bb476 100644
--- a/debian/patches/Skip-test_module_name_source_match.patch
+++ b/debian/patches/Skip-test_module_name_source_match.patch
@@ -52,7 +52,7 @@ index feae262eff..d9010c0153 100644
  
  # Import Salt libs
  import salt.utils.path
-@@ -95,6 +96,7 @@ class BadTestModuleNamesTestCase(TestCase):
+@@ -94,6 +95,7 @@ class BadTestModuleNamesTestCase(TestCase):
          error_msg += 'If it is a tests module, then please rename as suggested.'
          self.assertEqual([], bad_names, error_msg)
  
diff --git a/debian/patches/doc-fix-logo-link.patch b/debian/patches/doc-fix-logo-link.patch
new file mode 100644
index 00000000..9d7a753e
--- /dev/null
+++ b/debian/patches/doc-fix-logo-link.patch
@@ -0,0 +1,27 @@
+From 5c3036d248c4ae76d2fa7598cde179294aa4b2bb Mon Sep 17 00:00:00 2001
+From: Steffen Kockel <steffen.kockel@profitbricks.com>
+Date: Tue, 23 Apr 2019 17:45:00 +0200
+Subject: [PATCH] doc: Fix logo link
+
+The link on the brand image was pointing to index.html which does not
+exist. The index file seems to be contents.html.
+---
+ doc/_themes/saltstack/layout.html | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/doc/_themes/saltstack/layout.html b/doc/_themes/saltstack/layout.html
+index 85e0a3cf..d5ff2cd6 100644
+--- a/doc/_themes/saltstack/layout.html
++++ b/doc/_themes/saltstack/layout.html
+@@ -181,7 +181,7 @@
+                         <span class="icon-bar"></span>
+                         <span class="icon-bar"></span>
+                     </a>
+-                    <a class="brand" href="{{ pathto('index') }}"><img src="{{ pathto('_static/images/SaltStack-Logo.png', 1) }}" /></a>
++                    <a class="brand" href="{{ pathto('contents') }}"><img src="{{ pathto('_static/images/SaltStack-Logo.png', 1) }}" /></a>
+                     <div class="nav-collapse collapse">
+                         {%- block relbar1 %}{{ relbar() }}{% endblock %}
+                     </div>
+-- 
+2.17.1
+
diff --git a/debian/patches/ensure-searchtools.js-gets-included.patch b/debian/patches/ensure-searchtools.js-gets-included.patch
new file mode 100644
index 00000000..51be6e31
--- /dev/null
+++ b/debian/patches/ensure-searchtools.js-gets-included.patch
@@ -0,0 +1,28 @@
+From fbe10bf5c46e8a4b0ab943b45db223116e5cfc39 Mon Sep 17 00:00:00 2001
+From: Steffen Kockel <steffen.kockel@profitbricks.com>
+Date: Wed, 24 Apr 2019 16:57:13 +0200
+Subject: [PATCH] doc: Ensure searchtools.js gets included
+
+Searchtools did not get included with Debian > stretch and
+Sphinx > 1.6.7.
+---
+ doc/_themes/saltstack/layout.html | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/doc/_themes/saltstack/layout.html b/doc/_themes/saltstack/layout.html
+index 85e0a3cf..6e5c70e0 100644
+--- a/doc/_themes/saltstack/layout.html
++++ b/doc/_themes/saltstack/layout.html
+@@ -29,6 +29,9 @@
+     '_static/js/vendor/jquery-1.9.1.js',
+     '_static/js/vendor/bootstrap.min.js',
+ ] + script_files %}
++{% if not '_static/searchtools.js' in script_files %}
++{% set script_files = script_files + ['_static/searchtools.js'] %}
++{% endif %}
+ 
+ {%- macro relbar() %}
+     <div class="related">
+-- 
+2.17.1
+
diff --git a/debian/patches/remove-privacy-breach.patch b/debian/patches/remove-privacy-breach.patch
index abe42048..1c7ce523 100644
--- a/debian/patches/remove-privacy-breach.patch
+++ b/debian/patches/remove-privacy-breach.patch
@@ -40,3 +40,13 @@ Author: Ondřej Nový <onovy@debian.org>
          </div>
      </div>
  
+--- a/doc/_themes/saltstack/layout.html
++++ b/doc/_themes/saltstack/layout.html
+@@ -117,7 +117,6 @@
+         <meta name="viewport" content="width=device-width, initial-scale=1.0">
+         <meta name="google-site-verification" content="1Y-ojT3ndjxA9coB77iUDyXPWxeuQ3T4_r0j-QG6QHg" />
+ 
+-        <link href='http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,600,700,800,300' rel='stylesheet' type='text/css'>
+         {{ css() }}
+ 
+         {%- if not embedded %}
diff --git a/debian/patches/series b/debian/patches/series
index 530a937e..2b610d8f 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,9 +1,13 @@
 gitfs-Fix-use-of-deprecated-pygit2-function.patch
+Fix-retrieve-systemd-version-using-regex.patch
+Fix-edge-case-when-minion-ID-is-a-16-character-string.patch
 prevent_intersphinx_network_access.patch
 Make-the-Salt-Proxy-environment-aware.patch
 remove-privacy-breach.patch
 Make-default-pki-directory-configurable.patch
 Do-not-load-zyppnotify-file-on-module-import.patch
+0001-Skip-SampleConfTest-if-sample-conf-directories-are-m.patch
+0002-Skip-ExtendTestCase-if-templates-directory-is-missin.patch
 disable-failing-tests.patch
 run-salt-master-as-salt-user.patch
 Support-unittest.mock-from-Python-3.6-again.patch
@@ -12,6 +16,9 @@ ignore-failing-kubernetes-test.patch
 test_argspec_report-Fix-expected-argspec_report-resu.patch
 Silence-linux_distribution-deprecation-warning.patch
 Skip-test_module_name_source_match.patch
+Fix-test_xen_virtual-on-kernels-with-no-Xen-support.patch
+doc-fix-logo-link.patch
+ensure-searchtools.js-gets-included.patch
 0001-Import-tornado.gen-as-tornado_gen.patch
 0002-Explicitly-import-attributes-from-tornado.patch
 0003-Use-renamed-python3-tornado4.patch
diff --git a/debian/rules b/debian/rules
index 8b05f8d3..a2bc895c 100755
--- a/debian/rules
+++ b/debian/rules
@@ -7,6 +7,7 @@
 
 override_dh_auto_build:
 	dh_auto_build
+	rm -f doc/_themes/saltstack/static/css/*.min.css doc/_themes/saltstack/static/js/vendor/*.js
 	HTML_THEME=saltstack make -C doc html SPHINXBUILD=/usr/share/sphinx/scripts/python3/sphinx-build
 	HTML_THEME=saltstack make -C doc man SPHINXBUILD=/usr/share/sphinx/scripts/python3/sphinx-build
 
@@ -20,12 +21,15 @@ override_dh_auto_clean:
 
 override_dh_auto_test:
 ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
-	python3 ./tests/runtests.py -v --no-report --unit
+	LC_ALL=C.UTF-8 python3 ./tests/runtests.py -v --no-report --unit
 endif
 
 override_dh_install:
 	dh_install -X/usr/share/man/man
 
+override_dh_compress:
+	dh_compress -X.ico
+
 override_dh_fixperms:
 	dh_fixperms
 	chmod 2750 debian/salt-common/var/log/salt
diff --git a/debian/salt-common.docs b/debian/salt-common.docs
deleted file mode 100644
index 6d5ee1d0..00000000
--- a/debian/salt-common.docs
+++ /dev/null
@@ -1 +0,0 @@
-NOTICE
diff --git a/debian/salt-doc.links b/debian/salt-doc.links
index d7c56a96..ac7eb32b 100644
--- a/debian/salt-doc.links
+++ b/debian/salt-doc.links
@@ -1,3 +1,5 @@
+usr/share/doc/salt/html/_static/favicon.ico usr/share/doc/salt/html/favicon.ico
+usr/share/javascript/bootstrap/js/bootstrap.min.js usr/share/doc/salt/html/_static/js/vendor/bootstrap.min.js
 usr/share/javascript/jquery/jquery.js usr/share/doc/salt/html/_static/js/vendor/jquery-1.9.1.js
 usr/share/javascript/modernizr/modernizr.min.js usr/share/doc/salt/html/_static/js/vendor/modernizr-2.6.2-respond-1.1.0.min.js
 usr/share/javascript/sphinxdoc/1.0/doctools.js usr/share/doc/salt/html/_static/doctools.js
@@ -5,7 +7,3 @@ usr/share/javascript/sphinxdoc/1.0/jquery.js usr/share/doc/salt/html/_static/jqu
 usr/share/javascript/sphinxdoc/1.0/searchtools.js usr/share/doc/salt/html/_static/searchtools.js
 usr/share/javascript/sphinxdoc/1.0/sidebar.js usr/share/doc/salt/html/_static/sidebar.js
 usr/share/javascript/sphinxdoc/1.0/underscore.js usr/share/doc/salt/html/_static/underscore.js
-usr/share/twitter-bootstrap/files/css/bootstrap-responsive.min.css usr/share/doc/salt/html/_static/css/bootstrap-responsive.min.css
-usr/share/twitter-bootstrap/files/css/bootstrap.min.css usr/share/doc/salt/html/_static/css/bootstrap.min.css
-usr/share/twitter-bootstrap/files/js/bootstrap.js usr/share/doc/salt/html/_static/js/vendor/bootstrap.js
-usr/share/twitter-bootstrap/files/js/bootstrap.min.js usr/share/doc/salt/html/_static/js/vendor/bootstrap.min.js
diff --git a/debian/tests/control b/debian/tests/control
index e4b52171..aac3c419 100644
--- a/debian/tests/control
+++ b/debian/tests/control
@@ -1,4 +1,4 @@
-Test-Command: cp -r conf scripts templates tests "$AUTOPKGTEST_TMP"; cd "$AUTOPKGTEST_TMP"; python3 ./tests/runtests.py -v --no-report --unit
+Test-Command: cp -r conf scripts tests "$AUTOPKGTEST_TMP"; cd "$AUTOPKGTEST_TMP"; python3 ./tests/runtests.py -v --no-report --unit
 Depends: python3 (>= 3.6) | python3-mock,
          python3-augeas,
          python3-boto,

Reply to: