mirror of
https://github.com/certbot/certbot.git
synced 2026-01-21 19:01:07 +03:00
Use CLI_DEFAULTS in plugins
This commit is contained in:
@@ -86,16 +86,16 @@ class ApacheConfigurator(augeas_configurator.AugeasConfigurator):
|
||||
|
||||
@classmethod
|
||||
def add_parser_arguments(cls, add):
|
||||
add("server-root", default=constants.DEFAULT_SERVER_ROOT,
|
||||
add("server-root", default=constants.CLI_DEFAULTS["server_root"],
|
||||
help="Apache server root directory.")
|
||||
add("mod-ssl-conf", default=constants.DEFAULT_MOD_SSL_CONF,
|
||||
add("mod-ssl-conf", default=constants.CLI_DEFAULTS["mod_ssl_conf"],
|
||||
help="Contains standard Apache SSL directives.")
|
||||
add("ctl", default=constants.DEFAULT_CTL,
|
||||
add("ctl", default=constants.CLI_DEFAULTS["ctl"],
|
||||
help="Path to the 'apache2ctl' binary, used for 'configtest' and "
|
||||
"retrieving Apache2 version number.")
|
||||
add("enmod", default=constants.DEFAULT_ENMOD,
|
||||
add("enmod", default=constants.CLI_DEFAULTS["enmod"],
|
||||
help="Path to the Apache 'a2enmod' binary.")
|
||||
add("init-script", default=constants.DEFAULT_INIT_SCRIPT,
|
||||
add("init-script", default=constants.CLI_DEFAULTS["init_script"],
|
||||
help="Path to the Apache init script (used for server "
|
||||
"reload/restart).")
|
||||
|
||||
|
||||
@@ -2,12 +2,14 @@
|
||||
import pkg_resources
|
||||
|
||||
|
||||
# CLI/IConfig defaults
|
||||
DEFAULT_SERVER_ROOT = "/etc/apache2"
|
||||
DEFAULT_MOD_SSL_CONF = "/etc/letsencrypt/options-ssl.conf"
|
||||
DEFAULT_CTL = "apache2ctl"
|
||||
DEFAULT_ENMOD = "a2enmod"
|
||||
DEFAULT_INIT_SCRIPT = "/etc/init.d/apache2"
|
||||
CLI_DEFAULTS = dict(
|
||||
server_root="/etc/apache2",
|
||||
mod_ssl_conf="/etc/letsencrypt/options-ssl.conf",
|
||||
ctl="apache2ctl",
|
||||
enmod="a2enmod",
|
||||
init_script="/etc/init.d/apache2",
|
||||
)
|
||||
"""CLI defaults."""
|
||||
|
||||
|
||||
MOD_SSL_CONF = pkg_resources.resource_filename(
|
||||
|
||||
@@ -55,11 +55,11 @@ class NginxConfigurator(common.Plugin):
|
||||
|
||||
@classmethod
|
||||
def add_parser_arguments(cls, add):
|
||||
add("server-root", default=constants.DEFAULT_SERVER_ROOT,
|
||||
add("server-root", default=constants.CLI_DEFAULTS["server_root"],
|
||||
help="Nginx server root directory.")
|
||||
add("mod-ssl-conf", default=constants.DEFAULT_MOD_SSL_CONF,
|
||||
add("mod-ssl-conf", default=constants.CLI_DEFAULTS["mod_ssl_conf"],
|
||||
help="Contains standard nginx SSL directives.")
|
||||
add("ctl", default=constants.DEFAULT_CTL, help="Path to the "
|
||||
add("ctl", default=constants.CLI_DEFAULTS["ctl"], help="Path to the "
|
||||
"'nginx' binary, used for 'configtest' and retrieving nginx "
|
||||
"version number.")
|
||||
|
||||
|
||||
@@ -2,9 +2,12 @@
|
||||
import pkg_resources
|
||||
|
||||
|
||||
DEFAULT_SERVER_ROOT = "/etc/nginx"
|
||||
DEFAULT_MOD_SSL_CONF = "/etc/letsencrypt/options-ssl-nginx.conf"
|
||||
DEFAULT_CTL = "nginx"
|
||||
CLI_DEFAULTS = dict(
|
||||
server_root="/etc/nginx",
|
||||
mod_ssl_conf="/etc/letsencrypt/options-ssl-nginx.conf",
|
||||
ctl="nginx",
|
||||
)
|
||||
"""CLI defaults."""
|
||||
|
||||
|
||||
MOD_SSL_CONF = pkg_resources.resource_filename(
|
||||
|
||||
Reference in New Issue
Block a user