Ejemplo n.º 1
0
def renew(config, unused_plugins):
    """Renew previously-obtained certificates.

    :param config: Configuration object
    :type config: interfaces.IConfig

    :param unused_plugins: List of plugins (deprecated)
    :type unused_plugins: `list` of `str`

    :returns: `None`
    :rtype: None

    """
    if not sys.stdin.isatty():
        # Noninteractive renewals include a random delay in order to spread
        # out the load on the certificate authority servers, even if many
        # users all pick the same time for renewals.  This delay precedes
        # running any hooks, so that side effects of the hooks (such as
        # shutting down a web service) aren't prolonged unnecessarily.
        sleep_time = random.randint(1, 60*8)
        logger.info("Non-interactive renewal: random delay of %s seconds", sleep_time)
        time.sleep(sleep_time)

    try:
        renewal.handle_renewal_request(config)
    finally:
        hooks.run_saved_post_hooks()
Ejemplo n.º 2
0
def renew(config, unused_plugins):
    """Renew previously-obtained certificates.

    :param config: Configuration object
    :type config: interfaces.IConfig

    :param unused_plugins: List of plugins (deprecated)
    :type unused_plugins: `list` of `str`

    :returns: `None`
    :rtype: None

    """
    try:
        renewal.handle_renewal_request(config)
    finally:
        hooks.run_saved_post_hooks()
Ejemplo n.º 3
0
def renew(config, unused_plugins):
    """Renew previously-obtained certificates.

    :param config: Configuration object
    :type config: interfaces.IConfig

    :param unused_plugins: List of plugins (deprecated)
    :type unused_plugins: `list` of `str`

    :returns: `None`
    :rtype: None

    """
    try:
        renewal.handle_renewal_request(config)
    finally:
        hooks.run_saved_post_hooks()
Ejemplo n.º 4
0
def renew(config, unused_plugins):
    """Renew previously-obtained certificates."""
    try:
        renewal.handle_renewal_request(config)
    finally:
        hooks.run_saved_post_hooks()
Ejemplo n.º 5
0
 def _call(cls, *args, **kwargs):
     from certbot.hooks import run_saved_post_hooks
     return run_saved_post_hooks()
Ejemplo n.º 6
0
def renew(config, unused_plugins):
    """Renew previously-obtained certificates."""
    try:
        renewal.handle_renewal_request(config)
    finally:
        hooks.run_saved_post_hooks()
Ejemplo n.º 7
0
 def _test_renew_post_hooks(self, expected_count):
     with mock.patch('certbot.hooks.logger.info') as mock_info:
         with mock.patch('certbot.hooks._run_hook') as mock_run:
             hooks.run_saved_post_hooks()
             self.assertEqual(mock_run.call_count, expected_count)
             self.assertEqual(mock_info.call_count, expected_count)
Ejemplo n.º 8
0
 def _call(cls, *args, **kwargs):
     from certbot.hooks import run_saved_post_hooks
     return run_saved_post_hooks()
Ejemplo n.º 9
0
 def _test_renew_post_hooks(self, expected_count):
     with mock.patch('certbot.hooks.logger.info') as mock_info:
         with mock.patch('certbot.hooks._run_hook') as mock_run:
             hooks.run_saved_post_hooks()
             self.assertEqual(mock_run.call_count, expected_count)
             self.assertEqual(mock_info.call_count, expected_count)