mirror of
https://github.com/certbot/certbot.git
synced 2026-08-03 19:52:34 +02:00
Abstracted the -D DUMP_RUN_CFG command to use os specific one, defined in constants
This commit is contained in:
@@ -7,7 +7,8 @@ CLI_DEFAULTS_DEBIAN = dict(
|
|||||||
server_root="/etc/apache2",
|
server_root="/etc/apache2",
|
||||||
vhost_root="/etc/apache2/sites-available",
|
vhost_root="/etc/apache2/sites-available",
|
||||||
ctl="apache2ctl",
|
ctl="apache2ctl",
|
||||||
version_cmd='apache2ctl -v',
|
version_cmd="apache2ctl -v",
|
||||||
|
define_cmd="apache2ctl -t -D DUMP_RUN_CFG",
|
||||||
enmod="a2enmod",
|
enmod="a2enmod",
|
||||||
dismod="a2dismod",
|
dismod="a2dismod",
|
||||||
le_vhost_ext="-le-ssl.conf",
|
le_vhost_ext="-le-ssl.conf",
|
||||||
@@ -20,6 +21,7 @@ CLI_DEFAULTS_CENTOS = dict(
|
|||||||
vhost_root="/etc/httpd/conf.d",
|
vhost_root="/etc/httpd/conf.d",
|
||||||
ctl="apachectl",
|
ctl="apachectl",
|
||||||
version_cmd="apachectl -v",
|
version_cmd="apachectl -v",
|
||||||
|
define_cmd="apachectl -t -D DUMP_RUN_CFG",
|
||||||
enmod=None,
|
enmod=None,
|
||||||
dismod=None,
|
dismod=None,
|
||||||
le_vhost_ext="-le-ssl.conf",
|
le_vhost_ext="-le-ssl.conf",
|
||||||
@@ -32,6 +34,7 @@ CLI_DEFAULTS_GENTOO = dict(
|
|||||||
vhost_root="/etc/apache2/vhosts.d",
|
vhost_root="/etc/apache2/vhosts.d",
|
||||||
ctl="apache2ctl",
|
ctl="apache2ctl",
|
||||||
version_cmd="/usr/sbin/apache2 -v",
|
version_cmd="/usr/sbin/apache2 -v",
|
||||||
|
define_cmd="/usr/sbin/apache2 -t -D DUMP_RUN_CFG",
|
||||||
enmod=None,
|
enmod=None,
|
||||||
dismod=None,
|
dismod=None,
|
||||||
le_vhost_ext="-le-ssl.conf",
|
le_vhost_ext="-le-ssl.conf",
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import subprocess
|
|||||||
|
|
||||||
from letsencrypt import errors
|
from letsencrypt import errors
|
||||||
|
|
||||||
|
from letsencrypt_apache import constants
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
@@ -108,7 +109,7 @@ class ApacheParser(object):
|
|||||||
for match in matches:
|
for match in matches:
|
||||||
if match.count("=") > 1:
|
if match.count("=") > 1:
|
||||||
logger.error("Unexpected number of equal signs in "
|
logger.error("Unexpected number of equal signs in "
|
||||||
"apache2ctl -D DUMP_RUN_CFG")
|
"runtime config dump.")
|
||||||
raise errors.PluginError(
|
raise errors.PluginError(
|
||||||
"Error parsing Apache runtime variables")
|
"Error parsing Apache runtime variables")
|
||||||
parts = match.partition("=")
|
parts = match.partition("=")
|
||||||
@@ -124,7 +125,7 @@ class ApacheParser(object):
|
|||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
proc = subprocess.Popen(
|
proc = subprocess.Popen(
|
||||||
[ctl, "-t", "-D", "DUMP_RUN_CFG"],
|
constants.os_constant("define_cmd").split(" "),
|
||||||
stdout=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
stderr=subprocess.PIPE)
|
stderr=subprocess.PIPE)
|
||||||
stdout, stderr = proc.communicate()
|
stdout, stderr = proc.communicate()
|
||||||
|
|||||||
Reference in New Issue
Block a user