mirror of
https://github.com/certbot/certbot.git
synced 2026-06-03 13:59:02 -04:00
Parse variables without whitespace separator correctly in CentOS family of distributions
This commit is contained in:
parent
8bc785ed46
commit
5d3a0c1015
3 changed files with 7 additions and 1 deletions
|
|
@ -93,4 +93,8 @@ def parse_define_file(filepath, varname):
|
|||
if v == "-D" and len(a_opts) >= i+2:
|
||||
var_parts = a_opts[i+1].partition("=")
|
||||
return_vars[var_parts[0]] = var_parts[2]
|
||||
elif len(v) > 2 and v.startswith("-D"):
|
||||
# Found var with no whitespace separator
|
||||
var_parts = v[2:].partition("=")
|
||||
return_vars[var_parts[0]] = var_parts[2]
|
||||
return return_vars
|
||||
|
|
|
|||
|
|
@ -118,6 +118,8 @@ class MultipleVhostsTestCentOS(util.ApacheTest):
|
|||
self.assertTrue("mock_define_too" in self.config.parser.variables.keys())
|
||||
self.assertTrue("mock_value" in self.config.parser.variables.keys())
|
||||
self.assertEqual("TRUE", self.config.parser.variables["mock_value"])
|
||||
self.assertTrue("MOCK_NOSEP" in self.config.parser.variables.keys())
|
||||
self.assertEqual("NOSEP_VAL", self.config.parser.variables["NOSEP_TWO"])
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main() # pragma: no cover
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
# To pass additional options (for instance, -D definitions) to the
|
||||
# httpd binary at startup, set OPTIONS here.
|
||||
#
|
||||
OPTIONS="-D mock_define -D mock_define_too -D mock_value=TRUE"
|
||||
OPTIONS="-D mock_define -D mock_define_too -D mock_value=TRUE -DMOCK_NOSEP -DNOSEP_TWO=NOSEP_VAL"
|
||||
|
||||
#
|
||||
# This setting ensures the httpd process is started in the "C" locale
|
||||
|
|
|
|||
Loading…
Reference in a new issue