mirror of
https://github.com/certbot/certbot.git
synced 2026-06-07 15:52:08 -04:00
Ensure that path_surgery doesn't happen until we have a logger
This commit is contained in:
parent
186a8c888f
commit
6a67ce5567
2 changed files with 15 additions and 10 deletions
|
|
@ -18,7 +18,6 @@ import certbot
|
|||
from certbot import constants
|
||||
from certbot import crypto_util
|
||||
from certbot import errors
|
||||
from certbot import hooks
|
||||
from certbot import interfaces
|
||||
from certbot import util
|
||||
|
||||
|
|
@ -394,9 +393,6 @@ class HelpfulArgumentParser(object):
|
|||
if parsed_args.must_staple:
|
||||
parsed_args.staple = True
|
||||
|
||||
if parsed_args.validate_hooks:
|
||||
hooks.validate_hooks(parsed_args)
|
||||
|
||||
return parsed_args
|
||||
|
||||
def set_test_server(self, parsed_args):
|
||||
|
|
|
|||
|
|
@ -782,6 +782,20 @@ def set_displayer(config):
|
|||
displayer = display_util.FileDisplay(sys.stdout)
|
||||
zope.component.provideUtility(displayer)
|
||||
|
||||
def _post_logging_setup(config, plugins, cli_args):
|
||||
"Perform any setup or configuration tasks that require a logger."
|
||||
|
||||
# This needs logging, but would otherwise be in HelpfulArgumentParser
|
||||
if config.validate_hooks:
|
||||
hooks.validate_hooks(config)
|
||||
|
||||
cli.possible_deprecation_warning(config)
|
||||
|
||||
logger.debug("certbot version: %s", certbot.__version__)
|
||||
# do not log `config`, as it contains sensitive data (e.g. revoke --key)!
|
||||
logger.debug("Arguments: %r", cli_args)
|
||||
logger.debug("Discovered plugins: %r", plugins)
|
||||
|
||||
|
||||
def main(cli_args=sys.argv[1:]):
|
||||
"""Command line argument parsing and main script execution."""
|
||||
|
|
@ -799,12 +813,7 @@ def main(cli_args=sys.argv[1:]):
|
|||
# logger ..." TODO: this should be done before plugins discovery
|
||||
setup_logging(config)
|
||||
|
||||
cli.possible_deprecation_warning(config)
|
||||
|
||||
logger.debug("certbot version: %s", certbot.__version__)
|
||||
# do not log `config`, as it contains sensitive data (e.g. revoke --key)!
|
||||
logger.debug("Arguments: %r", cli_args)
|
||||
logger.debug("Discovered plugins: %r", plugins)
|
||||
_post_logging_setup(config, plugins, cli_args)
|
||||
|
||||
sys.excepthook = functools.partial(_handle_exception, config=config)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue