Hello community,

here is the log from the commit of package python-certbot-nginx for 
openSUSE:Factory checked in at 2020-08-21 19:13:09
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-certbot-nginx (Old)
 and      /work/SRC/openSUSE:Factory/.python-certbot-nginx.new.3399 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-certbot-nginx"

Fri Aug 21 19:13:09 2020 rev:22 rq:828430 version:1.7.0

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/python-certbot-nginx/python-certbot-nginx.changes    
    2020-07-15 15:03:08.383300015 +0200
+++ 
/work/SRC/openSUSE:Factory/.python-certbot-nginx.new.3399/python-certbot-nginx.changes
      2020-08-21 19:13:45.464697722 +0200
@@ -1,0 +2,6 @@
+Fri Aug 21 08:44:19 UTC 2020 - Marketa Calabkova <[email protected]>
+
+- update to version 1.7.0
+  * Added --nginx-sleep-seconds (default 1) for environments where nginx takes 
a long time to reload.
+
+-------------------------------------------------------------------

Old:
----
  certbot-nginx-1.6.0.tar.gz

New:
----
  certbot-nginx-1.7.0.tar.gz

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

Other differences:
------------------
++++++ python-certbot-nginx.spec ++++++
--- /var/tmp/diff_new_pack.HrbJxr/_old  2020-08-21 19:13:46.664698434 +0200
+++ /var/tmp/diff_new_pack.HrbJxr/_new  2020-08-21 19:13:46.668698437 +0200
@@ -18,7 +18,7 @@
 
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 Name:           python-certbot-nginx
-Version:        1.6.0
+Version:        1.7.0
 Release:        0
 Summary:        Nginx plugin for Certbot
 License:        Apache-2.0

++++++ certbot-nginx-1.6.0.tar.gz -> certbot-nginx-1.7.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/certbot-nginx-1.6.0/PKG-INFO 
new/certbot-nginx-1.7.0/PKG-INFO
--- old/certbot-nginx-1.6.0/PKG-INFO    2020-07-07 19:13:40.000000000 +0200
+++ new/certbot-nginx-1.7.0/PKG-INFO    2020-08-04 20:20:23.109773400 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 1.2
 Name: certbot-nginx
-Version: 1.6.0
+Version: 1.7.0
 Summary: Nginx plugin for Certbot
 Home-page: https://github.com/letsencrypt/letsencrypt
 Author: Certbot Project
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/certbot-nginx-1.6.0/certbot_nginx/_internal/configurator.py 
new/certbot-nginx-1.7.0/certbot_nginx/_internal/configurator.py
--- old/certbot-nginx-1.6.0/certbot_nginx/_internal/configurator.py     
2020-07-07 19:13:20.000000000 +0200
+++ new/certbot-nginx-1.7.0/certbot_nginx/_internal/configurator.py     
2020-08-04 20:20:15.000000000 +0200
@@ -77,6 +77,9 @@
         add("ctl", default=constants.CLI_DEFAULTS["ctl"], help="Path to the "
             "'nginx' binary, used for 'configtest' and retrieving nginx "
             "version number.")
+        add("sleep-seconds", default=constants.CLI_DEFAULTS["sleep_seconds"], 
type=int,
+            help="Number of seconds to wait for nginx configuration changes "
+            "to apply when reloading.")
 
     @property
     def nginx_conf(self):
@@ -912,7 +915,7 @@
         :raises .errors.MisconfigurationError: If either the reload fails.
 
         """
-        nginx_restart(self.conf('ctl'), self.nginx_conf)
+        nginx_restart(self.conf('ctl'), self.nginx_conf, 
self.conf('sleep-seconds'))
 
     def config_test(self):
         """Check the configuration of Nginx for errors.
@@ -1159,7 +1162,7 @@
     return redirect_block
 
 
-def nginx_restart(nginx_ctl, nginx_conf):
+def nginx_restart(nginx_ctl, nginx_conf, sleep_duration):
     """Restarts the Nginx Server.
 
     .. todo:: Nginx restart is fatal if the configuration references
@@ -1167,6 +1170,8 @@
         before restart.
 
     :param str nginx_ctl: Path to the Nginx binary.
+    :param str nginx_conf: Path to the Nginx configuration file.
+    :param int sleep_duration: How long to sleep after sending the reload 
signal.
 
     """
     try:
@@ -1190,10 +1195,12 @@
 
     except (OSError, ValueError):
         raise errors.MisconfigurationError("nginx restart failed")
-    # Nginx can take a moment to recognize a newly added TLS SNI servername, 
so sleep
-    # for a second. TODO: Check for expected servername and loop until it
-    # appears or return an error if looping too long.
-    time.sleep(1)
+    # Nginx can take a significant duration of time to fully apply a new 
config, depending
+    # on size and contents (https://github.com/certbot/certbot/issues/7422). 
Lacking a way
+    # to reliably identify when this process is complete, we provide the user 
with control
+    # over how long Certbot will sleep after reloading the configuration.
+    if sleep_duration > 0:
+        time.sleep(sleep_duration)
 
 
 def _determine_default_server_root():
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/certbot-nginx-1.6.0/certbot_nginx/_internal/constants.py 
new/certbot-nginx-1.7.0/certbot_nginx/_internal/constants.py
--- old/certbot-nginx-1.6.0/certbot_nginx/_internal/constants.py        
2020-07-07 19:13:20.000000000 +0200
+++ new/certbot-nginx-1.7.0/certbot_nginx/_internal/constants.py        
2020-08-04 20:20:15.000000000 +0200
@@ -1,6 +1,9 @@
 """nginx plugin constants."""
 import platform
 
+from acme.magic_typing import Any
+from acme.magic_typing import Dict
+
 FREEBSD_DARWIN_SERVER_ROOT = "/usr/local/etc/nginx"
 LINUX_SERVER_ROOT = "/etc/nginx"
 PKGSRC_SERVER_ROOT = "/usr/pkg/etc/nginx"
@@ -15,7 +18,8 @@
 CLI_DEFAULTS = dict(
     server_root=server_root_tmp,
     ctl="nginx",
-)
+    sleep_seconds=1
+) # type: Dict[str, Any]
 """CLI defaults."""
 
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/certbot-nginx-1.6.0/certbot_nginx.egg-info/PKG-INFO 
new/certbot-nginx-1.7.0/certbot_nginx.egg-info/PKG-INFO
--- old/certbot-nginx-1.6.0/certbot_nginx.egg-info/PKG-INFO     2020-07-07 
19:13:40.000000000 +0200
+++ new/certbot-nginx-1.7.0/certbot_nginx.egg-info/PKG-INFO     2020-08-04 
20:20:23.000000000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 1.2
 Name: certbot-nginx
-Version: 1.6.0
+Version: 1.7.0
 Summary: Nginx plugin for Certbot
 Home-page: https://github.com/letsencrypt/letsencrypt
 Author: Certbot Project
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/certbot-nginx-1.6.0/setup.py 
new/certbot-nginx-1.7.0/setup.py
--- old/certbot-nginx-1.6.0/setup.py    2020-07-07 19:13:23.000000000 +0200
+++ new/certbot-nginx-1.7.0/setup.py    2020-08-04 20:20:16.000000000 +0200
@@ -6,7 +6,7 @@
 from setuptools import setup
 from setuptools.command.test import test as TestCommand
 
-version = '1.6.0'
+version = '1.7.0'
 
 # Remember to update local-oldest-requirements.txt when changing the minimum
 # acme/certbot version.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/certbot-nginx-1.6.0/tests/configurator_test.py 
new/certbot-nginx-1.7.0/tests/configurator_test.py
--- old/certbot-nginx-1.6.0/tests/configurator_test.py  2020-07-07 
19:13:20.000000000 +0200
+++ new/certbot-nginx-1.7.0/tests/configurator_test.py  2020-08-04 
20:20:15.000000000 +0200
@@ -460,11 +460,13 @@
         self.assertEqual(self.config._get_openssl_version(), "")
 
     @mock.patch("certbot_nginx._internal.configurator.subprocess.Popen")
-    def test_nginx_restart(self, mock_popen):
+    @mock.patch("certbot_nginx._internal.configurator.time")
+    def test_nginx_restart(self, mock_time, mock_popen):
         mocked = mock_popen()
         mocked.communicate.return_value = ('', '')
         mocked.returncode = 0
         self.config.restart()
+        mock_time.sleep.assert_called_once_with(0.1234)
 
     @mock.patch("certbot_nginx._internal.configurator.subprocess.Popen")
     def test_nginx_restart_fail(self, mock_popen):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/certbot-nginx-1.6.0/tests/test_util.py 
new/certbot-nginx-1.7.0/tests/test_util.py
--- old/certbot-nginx-1.6.0/tests/test_util.py  2020-07-07 19:13:20.000000000 
+0200
+++ new/certbot-nginx-1.7.0/tests/test_util.py  2020-08-04 20:20:15.000000000 
+0200
@@ -56,6 +56,7 @@
         backups = os.path.join(work_dir, "backups")
 
         self.configuration.nginx_server_root = config_path
+        self.configuration.nginx_sleep_seconds = 0.1234
         self.configuration.le_vhost_ext = "-le-ssl.conf"
         self.configuration.config_dir = config_dir
         self.configuration.work_dir = work_dir


Reply via email to