mirror of
https://github.com/certbot/certbot.git
synced 2026-07-28 08:45:22 +02:00
BF: apache cfg parsing - relax assumption that value cannot contain = (#8930)
* BF: apache cfg parsing - relax assumption that value cannot contain = * Remove failing test_update_runtime_vars_bad_output * Add test Define statements: with = in value, and an empty value * update CHANGELOG Co-authored-by: Alex Zorin <alex@zorin.id.au>
This commit is contained in:
co-authored by
Alex Zorin
parent
693a2a7904
commit
5e87aee968
@@ -153,13 +153,10 @@ def parse_defines(apachectl):
|
||||
return {}
|
||||
|
||||
for match in matches:
|
||||
if match.count("=") > 1:
|
||||
logger.error("Unexpected number of equal signs in "
|
||||
"runtime config dump.")
|
||||
raise errors.PluginError(
|
||||
"Error parsing Apache runtime variables")
|
||||
parts = match.partition("=")
|
||||
variables[parts[0]] = parts[2]
|
||||
# Value could also contain = so split only once
|
||||
parts = match.split('=', 1)
|
||||
value = parts[1] if len(parts) == 2 else ''
|
||||
variables[parts[0]] = value
|
||||
|
||||
return variables
|
||||
|
||||
|
||||
Reference in New Issue
Block a user