Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-certbot-apache for 
openSUSE:Factory checked in at 2021-06-24 18:22:43
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-certbot-apache (Old)
 and      /work/SRC/openSUSE:Factory/.python-certbot-apache.new.2625 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-certbot-apache"

Thu Jun 24 18:22:43 2021 rev:28 rq:901679 version:1.16.0

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/python-certbot-apache/python-certbot-apache.changes  
    2021-05-12 19:33:07.418823949 +0200
+++ 
/work/SRC/openSUSE:Factory/.python-certbot-apache.new.2625/python-certbot-apache.changes
    2021-06-24 18:23:05.316950456 +0200
@@ -1,0 +2,6 @@
+Thu Jun 24 09:26:08 UTC 2021 - Mark??ta Machov?? <mmach...@suse.com>
+
+- update to version 1.16.0
+  * Require the latest certbot and acme plugins for simplicity
+
+-------------------------------------------------------------------

Old:
----
  certbot-apache-1.15.0.tar.gz

New:
----
  certbot-apache-1.16.0.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-certbot-apache.spec ++++++
--- /var/tmp/diff_new_pack.u6MsGh/_old  2021-06-24 18:23:05.788950980 +0200
+++ /var/tmp/diff_new_pack.u6MsGh/_new  2021-06-24 18:23:05.792950985 +0200
@@ -19,14 +19,14 @@
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 %define skip_python2 1
 Name:           python-certbot-apache
-Version:        1.15.0
+Version:        1.16.0
 Release:        0
 Summary:        Apache plugin for Certbot
 License:        Apache-2.0
 URL:            https://github.com/letsencrypt/letsencrypt
 Source:         
https://files.pythonhosted.org/packages/source/c/certbot-apache/certbot-apache-%{version}.tar.gz
 BuildRequires:  %{python_module augeas}
-BuildRequires:  %{python_module certbot >= 1.1.0}
+BuildRequires:  %{python_module certbot >= %{version}}
 BuildRequires:  %{python_module pytest}
 BuildRequires:  %{python_module setuptools}
 BuildRequires:  %{python_module zope.component}
@@ -35,9 +35,9 @@
 BuildRequires:  python-rpm-macros
 Requires:       apache2
 Requires:       augeas-lenses
-Requires:       python-acme >= 0.34.0
+Requires:       python-acme >= %{version}
 Requires:       python-augeas
-Requires:       python-certbot >= 1.1.0
+Requires:       python-certbot >= %{version}
 Requires:       python-zope.component
 Requires:       python-zope.interface
 BuildArch:      noarch

++++++ certbot-apache-1.15.0.tar.gz -> certbot-apache-1.16.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/certbot-apache-1.15.0/PKG-INFO 
new/certbot-apache-1.16.0/PKG-INFO
--- old/certbot-apache-1.15.0/PKG-INFO  2021-05-04 20:48:45.624423300 +0200
+++ new/certbot-apache-1.16.0/PKG-INFO  2021-06-01 19:49:36.872988500 +0200
@@ -1,12 +1,11 @@
 Metadata-Version: 2.1
 Name: certbot-apache
-Version: 1.15.0
+Version: 1.16.0
 Summary: Apache plugin for Certbot
 Home-page: https://github.com/letsencrypt/letsencrypt
 Author: Certbot Project
 Author-email: certbot-...@eff.org
 License: Apache License 2.0
-Description: UNKNOWN
 Platform: UNKNOWN
 Classifier: Development Status :: 5 - Production/Stable
 Classifier: Environment :: Plugins
@@ -27,3 +26,7 @@
 Classifier: Topic :: Utilities
 Requires-Python: >=3.6
 Provides-Extra: dev
+License-File: LICENSE.txt
+
+UNKNOWN
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/certbot-apache-1.15.0/certbot_apache/_internal/apache_util.py 
new/certbot-apache-1.16.0/certbot_apache/_internal/apache_util.py
--- old/certbot-apache-1.15.0/certbot_apache/_internal/apache_util.py   
2021-05-04 20:48:08.000000000 +0200
+++ new/certbot-apache-1.16.0/certbot_apache/_internal/apache_util.py   
2021-06-01 19:49:17.000000000 +0200
@@ -220,13 +220,14 @@
 
     """
     try:
-        proc = subprocess.Popen(
+        proc = subprocess.run(
             command,
             stdout=subprocess.PIPE,
             stderr=subprocess.PIPE,
             universal_newlines=True,
+            check=False,
             env=util.env_no_snap_for_external_calls())
-        stdout, stderr = proc.communicate()
+        stdout, stderr = proc.stdout, proc.stderr
 
     except (OSError, ValueError):
         logger.error(
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/certbot-apache-1.15.0/certbot_apache/_internal/assertions.py 
new/certbot-apache-1.16.0/certbot_apache/_internal/assertions.py
--- old/certbot-apache-1.15.0/certbot_apache/_internal/assertions.py    
2021-05-04 20:48:08.000000000 +0200
+++ new/certbot-apache-1.16.0/certbot_apache/_internal/assertions.py    
2021-06-01 19:49:17.000000000 +0200
@@ -136,6 +136,6 @@
     if any(isPass(path) for path in second):
         return
     for fpath in first:
-        assert any([fnmatch.fnmatch(fpath, spath) for spath in second])
+        assert any(fnmatch.fnmatch(fpath, spath) for spath in second)
     for spath in second:
-        assert any([fnmatch.fnmatch(fpath, spath) for fpath in first])
+        assert any(fnmatch.fnmatch(fpath, spath) for fpath in first)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/certbot-apache-1.15.0/certbot_apache/_internal/configurator.py 
new/certbot-apache-1.16.0/certbot_apache/_internal/configurator.py
--- old/certbot-apache-1.15.0/certbot_apache/_internal/configurator.py  
2021-05-04 20:48:08.000000000 +0200
+++ new/certbot-apache-1.16.0/certbot_apache/_internal/configurator.py  
2021-06-01 19:49:17.000000000 +0200
@@ -25,6 +25,7 @@
 from certbot.achallenges import KeyAuthorizationAnnotatedChallenge  # pylint: 
disable=unused-import
 from certbot.compat import filesystem
 from certbot.compat import os
+from certbot.display import util as display_util
 from certbot.plugins import common
 from certbot.plugins.enhancements import AutoHSTSEnhancement
 from certbot.plugins.util import path_surgery
@@ -515,6 +516,8 @@
         vhosts = self.choose_vhosts(domain)
         for vhost in vhosts:
             self._deploy_cert(vhost, cert_path, key_path, chain_path, 
fullchain_path)
+            display_util.notify("Successfully deployed certificate for {} to 
{}"
+                                .format(domain, vhost.filep))
 
     def choose_vhosts(self, domain, create_if_no_ssl=True):
         """
@@ -553,6 +556,19 @@
 
         return list(matched)
 
+    def _raise_no_suitable_vhost_error(self, target_name: str):
+        """
+        Notifies the user that Certbot could not find a vhost to secure
+        and raises an error.
+        :param str target_name: The server name that could not be mapped
+        :raises errors.PluginError: Raised unconditionally
+        """
+        raise errors.PluginError(
+            "Certbot could not find a VirtualHost for {0} in the Apache "
+            "configuration. Please create a VirtualHost with a ServerName "
+            "matching {0} and try again.".format(target_name)
+        )
+
     def _in_wildcard_scope(self, name, domain):
         """
         Helper method for _vhosts_for_wildcard() that makes sure that the 
domain
@@ -590,12 +606,7 @@
         dialog_output = display_ops.select_vhost_multiple(list(dialog_input))
 
         if not dialog_output:
-            logger.error(
-                "No vhost exists with servername or alias for domain %s. "
-                "No vhost was selected. Please specify ServerName or 
ServerAlias "
-                "in the Apache config.",
-                domain)
-            raise errors.PluginError("No vhost selected")
+            self._raise_no_suitable_vhost_error(domain)
 
         # Make sure we create SSL vhosts for the ones that are HTTP only
         # if requested.
@@ -719,12 +730,7 @@
         # Select a vhost from a list
         vhost = display_ops.select_vhost(target_name, self.vhosts)
         if vhost is None:
-            logger.error(
-                "No vhost exists with servername or alias of %s. "
-                "No vhost was selected. Please specify ServerName or 
ServerAlias "
-                "in the Apache config.",
-                target_name)
-            raise errors.PluginError("No vhost selected")
+            self._raise_no_suitable_vhost_error(target_name)
         if temp:
             return vhost
         if not vhost.ssl:
@@ -1532,12 +1538,11 @@
             raise errors.PluginError("Unable to write/read in make_vhost_ssl")
 
         if sift:
-            reporter = zope.component.getUtility(interfaces.IReporter)
-            reporter.add_message(
-                "Some rewrite rules copied from {0} were disabled in the "
-                "vhost for your HTTPS site located at {1} because they have "
-                "the potential to create redirection loops.".format(
-                    vhost.filep, ssl_fp), reporter.MEDIUM_PRIORITY)
+            display_util.notify(
+                f"Some rewrite rules copied from {vhost.filep} were disabled 
in the "
+                f"vhost for your HTTPS site located at {ssl_fp} because they 
have "
+                "the potential to create redirection loops."
+            )
         self.parser.aug.set("/augeas/files%s/mtime" % (self._escape(ssl_fp)), 
"0")
         self.parser.aug.set("/augeas/files%s/mtime" % 
(self._escape(vhost.filep)), "0")
 
@@ -1866,13 +1871,13 @@
             if options:
                 msg_enhancement += ": " + options
             msg = msg_tmpl.format(domain, msg_enhancement)
-            logger.warning(msg)
+            logger.error(msg)
             raise errors.PluginError(msg)
         try:
             for vhost in vhosts:
                 func(vhost, options)
         except errors.PluginError:
-            logger.warning("Failed %s for %s", enhancement, domain)
+            logger.error("Failed %s for %s", enhancement, domain)
             raise
 
     def _autohsts_increase(self, vhost, id_str, nextstep):
@@ -2396,7 +2401,7 @@
             vhost.enabled = True
         return
 
-    def enable_mod(self, mod_name, temp=False):
+    def enable_mod(self, mod_name, temp=False):  # pylint: 
disable=unused-argument
         """Enables module in Apache.
 
         Both enables and reloads Apache so module is active.
@@ -2436,7 +2441,7 @@
         try:
             util.run_script(self.options.restart_cmd)
         except errors.SubprocessError as err:
-            logger.info("Unable to restart apache using %s",
+            logger.warning("Unable to restart apache using %s",
                         self.options.restart_cmd)
             alt_restart = self.options.restart_cmd_alt
             if alt_restart:
@@ -2500,6 +2505,11 @@
                 version=".".join(str(i) for i in self.version))
         )
 
+    def auth_hint(self, failed_achalls): # pragma: no cover
+        return ("The Certificate Authority failed to verify the temporary 
Apache configuration "
+                "changes made by Certbot. Ensure that the listed domains point 
to this Apache "
+                "server and that it is accessible from the internet.")
+
     ###########################################################################
     # Challenges Section
     ###########################################################################
@@ -2593,7 +2603,7 @@
                 msg_tmpl = ("Certbot was not able to find SSL VirtualHost for 
a "
                             "domain {0} for enabling AutoHSTS enhancement.")
                 msg = msg_tmpl.format(d)
-                logger.warning(msg)
+                logger.error(msg)
                 raise errors.PluginError(msg)
             for vh in vhosts:
                 try:
@@ -2679,7 +2689,7 @@
                 except errors.PluginError:
                     msg = ("Could not find VirtualHost with ID {0}, disabling "
                            "AutoHSTS for this VirtualHost").format(id_str)
-                    logger.warning(msg)
+                    logger.error(msg)
                     # Remove the orphaned AutoHSTS entry from pluginstorage
                     self._autohsts.pop(id_str)
                     continue
@@ -2719,7 +2729,7 @@
                 except errors.PluginError:
                     msg = ("VirtualHost with id {} was not found, unable to "
                            "make HSTS max-age permanent.").format(id_str)
-                    logger.warning(msg)
+                    logger.error(msg)
                     self._autohsts.pop(id_str)
                     continue
                 if self._autohsts_vhost_in_lineage(vhost, lineage):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/certbot-apache-1.15.0/certbot_apache/_internal/display_ops.py 
new/certbot-apache-1.16.0/certbot_apache/_internal/display_ops.py
--- old/certbot-apache-1.15.0/certbot_apache/_internal/display_ops.py   
2021-05-04 20:48:08.000000000 +0200
+++ new/certbot-apache-1.16.0/certbot_apache/_internal/display_ops.py   
2021-06-01 19:49:17.000000000 +0200
@@ -119,7 +119,7 @@
             "guidance in non-interactive mode. Certbot may need "
             "vhosts to be explicitly labelled with ServerName or "
             "ServerAlias directives.".format(domain))
-        logger.warning(msg)
+        logger.error(msg)
         raise errors.MissingCommandlineFlag(msg)
 
     return code, tag
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/certbot-apache-1.15.0/certbot_apache/_internal/override_debian.py 
new/certbot-apache-1.16.0/certbot_apache/_internal/override_debian.py
--- old/certbot-apache-1.15.0/certbot_apache/_internal/override_debian.py       
2021-05-04 20:48:08.000000000 +0200
+++ new/certbot-apache-1.16.0/certbot_apache/_internal/override_debian.py       
2021-06-01 19:49:17.000000000 +0200
@@ -58,7 +58,7 @@
                 # Already in shape
                 vhost.enabled = True
                 return None
-            logger.warning(
+            logger.error(
                 "Could not symlink %s to %s, got error: %s", enabled_path,
                 vhost.filep, err.strerror)
             errstring = ("Encountered error while trying to enable a " +
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/certbot-apache-1.15.0/certbot_apache.egg-info/PKG-INFO 
new/certbot-apache-1.16.0/certbot_apache.egg-info/PKG-INFO
--- old/certbot-apache-1.15.0/certbot_apache.egg-info/PKG-INFO  2021-05-04 
20:48:45.000000000 +0200
+++ new/certbot-apache-1.16.0/certbot_apache.egg-info/PKG-INFO  2021-06-01 
19:49:36.000000000 +0200
@@ -1,12 +1,11 @@
 Metadata-Version: 2.1
 Name: certbot-apache
-Version: 1.15.0
+Version: 1.16.0
 Summary: Apache plugin for Certbot
 Home-page: https://github.com/letsencrypt/letsencrypt
 Author: Certbot Project
 Author-email: certbot-...@eff.org
 License: Apache License 2.0
-Description: UNKNOWN
 Platform: UNKNOWN
 Classifier: Development Status :: 5 - Production/Stable
 Classifier: Environment :: Plugins
@@ -27,3 +26,7 @@
 Classifier: Topic :: Utilities
 Requires-Python: >=3.6
 Provides-Extra: dev
+License-File: LICENSE.txt
+
+UNKNOWN
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/certbot-apache-1.15.0/certbot_apache.egg-info/requires.txt 
new/certbot-apache-1.16.0/certbot_apache.egg-info/requires.txt
--- old/certbot-apache-1.15.0/certbot_apache.egg-info/requires.txt      
2021-05-04 20:48:45.000000000 +0200
+++ new/certbot-apache-1.16.0/certbot_apache.egg-info/requires.txt      
2021-06-01 19:49:36.000000000 +0200
@@ -1,5 +1,5 @@
-acme>=0.29.0
-certbot>=1.6.0
+acme>=1.8.0
+certbot>=1.10.1
 python-augeas
 setuptools>=39.0.1
 zope.component
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/certbot-apache-1.15.0/setup.py 
new/certbot-apache-1.16.0/setup.py
--- old/certbot-apache-1.15.0/setup.py  2021-05-04 20:48:10.000000000 +0200
+++ new/certbot-apache-1.16.0/setup.py  2021-06-01 19:49:18.000000000 +0200
@@ -1,13 +1,13 @@
 from setuptools import find_packages
 from setuptools import setup
 
-version = '1.15.0'
+version = '1.16.0'
 
 # Remember to update local-oldest-requirements.txt when changing the minimum
 # acme/certbot version.
 install_requires = [
-    'acme>=0.29.0',
-    'certbot>=1.6.0',
+    'acme>=1.8.0',
+    'certbot>=1.10.1',
     'python-augeas',
     'setuptools>=39.0.1',
     'zope.component',
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/certbot-apache-1.15.0/tests/autohsts_test.py 
new/certbot-apache-1.16.0/tests/autohsts_test.py
--- old/certbot-apache-1.15.0/tests/autohsts_test.py    2021-05-04 
20:48:08.000000000 +0200
+++ new/certbot-apache-1.16.0/tests/autohsts_test.py    2021-06-01 
19:49:17.000000000 +0200
@@ -146,7 +146,7 @@
     @mock.patch("certbot_apache._internal.display_ops.select_vhost")
     def test_autohsts_no_ssl_vhost(self, mock_select):
         mock_select.return_value = self.vh_truth[0]
-        with 
mock.patch("certbot_apache._internal.configurator.logger.warning") as mock_log:
+        with mock.patch("certbot_apache._internal.configurator.logger.error") 
as mock_log:
             self.assertRaises(errors.PluginError,
                               self.config.enable_autohsts,
                               mock.MagicMock(), "invalid.example.com")
@@ -179,7 +179,7 @@
         self.config._autohsts_fetch_state()
         self.config._autohsts["orphan_id"] = {"laststep": 999, "timestamp": 0}
         self.config._autohsts_save_state()
-        with 
mock.patch("certbot_apache._internal.configurator.logger.warning") as mock_log:
+        with mock.patch("certbot_apache._internal.configurator.logger.error") 
as mock_log:
             self.config.deploy_autohsts(mock.MagicMock())
             self.assertTrue(mock_log.called)
             self.assertTrue(
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/certbot-apache-1.15.0/tests/centos6_test.py 
new/certbot-apache-1.16.0/tests/centos6_test.py
--- old/certbot-apache-1.15.0/tests/centos6_test.py     2021-05-04 
20:48:08.000000000 +0200
+++ new/certbot-apache-1.16.0/tests/centos6_test.py     2021-06-01 
19:49:17.000000000 +0200
@@ -1,5 +1,6 @@
 """Test for certbot_apache._internal.configurator for CentOS 6 overrides"""
 import unittest
+from unittest import mock
 
 from certbot.compat import os
 from certbot.errors import MisconfigurationError
@@ -65,7 +66,8 @@
                 raise Exception("Missed: %s" % vhost)  # pragma: no cover
         self.assertEqual(found, 2)
 
-    def test_loadmod_default(self):
+    @mock.patch("certbot_apache._internal.configurator.display_util.notify")
+    def test_loadmod_default(self, unused_mock_notify):
         ssl_loadmods = self.config.parser.find_dir(
             "LoadModule", "ssl_module", exclude=False)
         self.assertEqual(len(ssl_loadmods), 1)
@@ -95,7 +97,8 @@
             ifmod_args = self.config.parser.get_all_args(lm[:-17])
             self.assertTrue("!mod_ssl.c" in ifmod_args)
 
-    def test_loadmod_multiple(self):
+    @mock.patch("certbot_apache._internal.configurator.display_util.notify")
+    def test_loadmod_multiple(self, unused_mock_notify):
         sslmod_args = ["ssl_module", "modules/mod_ssl.so"]
         # Adds another LoadModule to main httpd.conf in addtition to ssl.conf
         self.config.parser.add_dir(self.config.parser.loc["default"], 
"LoadModule",
@@ -115,7 +118,8 @@
         for mod in post_loadmods:
             self.assertTrue(self.config.parser.not_modssl_ifmodule(mod))  
#pylint: disable=no-member
 
-    def test_loadmod_rootconf_exists(self):
+    @mock.patch("certbot_apache._internal.configurator.display_util.notify")
+    def test_loadmod_rootconf_exists(self, unused_mock_notify):
         sslmod_args = ["ssl_module", "modules/mod_ssl.so"]
         rootconf_ifmod = self.config.parser.get_ifmod(
             parser.get_aug_path(self.config.parser.loc["default"]),
@@ -142,7 +146,8 @@
             self.config.parser.get_all_args(mods[0][:-7]),
             sslmod_args)
 
-    def test_neg_loadmod_already_on_path(self):
+    @mock.patch("certbot_apache._internal.configurator.display_util.notify")
+    def test_neg_loadmod_already_on_path(self, unused_mock_notify):
         loadmod_args = ["ssl_module", "modules/mod_ssl.so"]
         ifmod = self.config.parser.get_ifmod(
             self.vh_truth[1].path, "!mod_ssl.c", beginning=True)
@@ -185,7 +190,8 @@
         # Make sure that none was changed
         self.assertEqual(pre_matches, post_matches)
 
-    def test_loadmod_not_found(self):
+    @mock.patch("certbot_apache._internal.configurator.display_util.notify")
+    def test_loadmod_not_found(self, unused_mock_notify):
         # Remove all existing LoadModule ssl_module... directives
         orig_loadmods = self.config.parser.find_dir("LoadModule",
                                                     "ssl_module",
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/certbot-apache-1.15.0/tests/configurator_test.py 
new/certbot-apache-1.16.0/tests/configurator_test.py
--- old/certbot-apache-1.15.0/tests/configurator_test.py        2021-05-04 
20:48:08.000000000 +0200
+++ new/certbot-apache-1.16.0/tests/configurator_test.py        2021-06-01 
19:49:17.000000000 +0200
@@ -337,7 +337,8 @@
         vhosts = self.config._non_default_vhosts(self.config.vhosts)
         self.assertEqual(len(vhosts), 10)
 
-    def test_deploy_cert_enable_new_vhost(self):
+    @mock.patch('certbot_apache._internal.configurator.display_util.notify')
+    def test_deploy_cert_enable_new_vhost(self, unused_mock_notify):
         # Create
         ssl_vhost = self.config.make_vhost_ssl(self.vh_truth[0])
         self.config.parser.modules["ssl_module"] = None
@@ -375,7 +376,8 @@
                 self.fail("Include shouldn't be added, as patched find_dir 
'finds' existing one") \
                     # pragma: no cover
 
-    def test_deploy_cert(self):
+    @mock.patch('certbot_apache._internal.configurator.display_util.notify')
+    def test_deploy_cert(self, unused_mock_notify):
         self.config.parser.modules["ssl_module"] = None
         self.config.parser.modules["mod_ssl.c"] = None
         self.config.parser.modules["socache_shmcb_module"] = None
@@ -891,7 +893,7 @@
             self.config.enhance, "certbot.demo", "unknown_enhancement")
 
     def test_enhance_no_ssl_vhost(self):
-        with 
mock.patch("certbot_apache._internal.configurator.logger.warning") as mock_log:
+        with mock.patch("certbot_apache._internal.configurator.logger.error") 
as mock_log:
             self.assertRaises(errors.PluginError, self.config.enhance,
                               "certbot.demo", "redirect")
             # Check that correct logger.warning was printed
@@ -1290,7 +1292,8 @@
             os.path.basename(inc_path) in self.config.parser.existing_paths[
                 os.path.dirname(inc_path)])
 
-    def test_deploy_cert_not_parsed_path(self):
+    @mock.patch('certbot_apache._internal.configurator.display_util.notify')
+    def test_deploy_cert_not_parsed_path(self, unused_mock_notify):
         # Make sure that we add include to root config for vhosts when
         # handle-sites is false
         self.config.parser.modules["ssl_module"] = None
@@ -1386,7 +1389,8 @@
             self.assertEqual(vhs[0], self.vh_truth[7])
 
 
-    def test_deploy_cert_wildcard(self):
+    @mock.patch('certbot_apache._internal.configurator.display_util.notify')
+    def test_deploy_cert_wildcard(self, unused_mock_notify):
         # pylint: disable=protected-access
         mock_choose_vhosts = mock.MagicMock()
         mock_choose_vhosts.return_value = [self.vh_truth[7]]
@@ -1606,8 +1610,8 @@
         self.assertEqual(self.config._get_new_vh_path(without_index, both),
                          with_index_2[0])
 
-    @certbot_util.patch_get_utility()
-    def test_make_vhost_ssl_with_existing_rewrite_rule(self, mock_get_utility):
+    @mock.patch("certbot_apache._internal.configurator.display_util.notify")
+    def test_make_vhost_ssl_with_existing_rewrite_rule(self, mock_notify):
         self.config.parser.modules["rewrite_module"] = None
 
         ssl_vhost = self.config.make_vhost_ssl(self.vh_truth[4])
@@ -1623,11 +1627,11 @@
                                     "\"http://new.example.com/docs/$1\";  
[R,L]")
         self.assertTrue(commented_rewrite_rule in conf_text)
         self.assertTrue(uncommented_rewrite_rule in conf_text)
-        mock_get_utility().add_message.assert_called_once_with(mock.ANY,
-                                                               mock.ANY)
+        self.assertEqual(mock_notify.call_count, 1)
+        self.assertIn("Some rewrite rules", mock_notify.call_args[0][0])
 
-    @certbot_util.patch_get_utility()
-    def test_make_vhost_ssl_with_existing_rewrite_conds(self, 
mock_get_utility):
+    @mock.patch("certbot_apache._internal.configurator.display_util.notify")
+    def test_make_vhost_ssl_with_existing_rewrite_conds(self, mock_notify):
         self.config.parser.modules["rewrite_module"] = None
 
         ssl_vhost = self.config.make_vhost_ssl(self.vh_truth[3])
@@ -1652,8 +1656,8 @@
         self.assertTrue(commented_cond1 in conf_line_set)
         self.assertTrue(commented_cond2 in conf_line_set)
         self.assertTrue(commented_rewrite_rule in conf_line_set)
-        mock_get_utility().add_message.assert_called_once_with(mock.ANY,
-                                                               mock.ANY)
+        self.assertEqual(mock_notify.call_count, 1)
+        self.assertIn("Some rewrite rules", mock_notify.call_args[0][0])
 
 
 class InstallSslOptionsConfTest(util.ApacheTest):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/certbot-apache-1.15.0/tests/debian_test.py 
new/certbot-apache-1.16.0/tests/debian_test.py
--- old/certbot-apache-1.15.0/tests/debian_test.py      2021-05-04 
20:48:08.000000000 +0200
+++ new/certbot-apache-1.16.0/tests/debian_test.py      2021-06-01 
19:49:17.000000000 +0200
@@ -49,10 +49,11 @@
 
     @mock.patch("certbot.util.run_script")
     @mock.patch("certbot.util.exe_exists")
-    @mock.patch("certbot_apache._internal.apache_util.subprocess.Popen")
-    def test_enable_mod(self, mock_popen, mock_exe_exists, mock_run_script):
-        mock_popen().communicate.return_value = ("Define: DUMP_RUN_CFG", "")
-        mock_popen().returncode = 0
+    @mock.patch("certbot_apache._internal.apache_util.subprocess.run")
+    def test_enable_mod(self, mock_run, mock_exe_exists, mock_run_script):
+        mock_run.return_value.stdout = "Define: DUMP_RUN_CFG"
+        mock_run.return_value.stderr = ""
+        mock_run.return_value.returncode = 0
         mock_exe_exists.return_value = True
 
         self.config.enable_mod("ssl")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/certbot-apache-1.15.0/tests/parser_test.py 
new/certbot-apache-1.16.0/tests/parser_test.py
--- old/certbot-apache-1.15.0/tests/parser_test.py      2021-05-04 
20:48:08.000000000 +0200
+++ new/certbot-apache-1.16.0/tests/parser_test.py      2021-06-01 
19:49:17.000000000 +0200
@@ -305,17 +305,19 @@
         self.assertRaises(
             errors.PluginError, self.parser.update_runtime_variables)
 
-    @mock.patch("certbot_apache._internal.apache_util.subprocess.Popen")
-    def test_update_runtime_vars_bad_ctl(self, mock_popen):
-        mock_popen.side_effect = OSError
+    @mock.patch("certbot_apache._internal.apache_util.subprocess.run")
+    def test_update_runtime_vars_bad_ctl(self, mock_run):
+        mock_run.side_effect = OSError
         self.assertRaises(
             errors.MisconfigurationError,
             self.parser.update_runtime_variables)
 
-    @mock.patch("certbot_apache._internal.apache_util.subprocess.Popen")
-    def test_update_runtime_vars_bad_exit(self, mock_popen):
-        mock_popen().communicate.return_value = ("", "")
-        mock_popen.returncode = -1
+    @mock.patch("certbot_apache._internal.apache_util.subprocess.run")
+    def test_update_runtime_vars_bad_exit(self, mock_run):
+        mock_proc = mock_run.return_value
+        mock_proc.stdout = ""
+        mock_proc.stderr = ""
+        mock_proc.returncode = -1
         self.assertRaises(
             errors.MisconfigurationError,
             self.parser.update_runtime_variables)

Reply via email to