mirror of
https://github.com/certbot/certbot.git
synced 2026-06-03 22:08:07 -04:00
does it work?
This commit is contained in:
parent
5d7ef49fac
commit
aa33c0fa83
1 changed files with 3 additions and 0 deletions
|
|
@ -520,6 +520,7 @@ def _add_directives(block, directives, replace):
|
|||
|
||||
|
||||
REPEATABLE_DIRECTIVES = set(['server_name', 'listen', 'include'])
|
||||
COMMENT = [" ", "#", " managed by Certbot"]
|
||||
|
||||
|
||||
def _add_directive(block, directive, replace):
|
||||
|
|
@ -544,6 +545,7 @@ def _add_directive(block, directive, replace):
|
|||
'expected directive for {0} in the Nginx '
|
||||
'config but did not find it.'.format(directive[0]))
|
||||
block[location] = directive
|
||||
block.insert(location + 1, COMMENT)
|
||||
else:
|
||||
# Append directive. Fail if the name is not a repeatable directive name,
|
||||
# and there is already a copy of that directive with a different value
|
||||
|
|
@ -553,6 +555,7 @@ def _add_directive(block, directive, replace):
|
|||
if location is None or (isinstance(directive_name, str) and
|
||||
directive_name in REPEATABLE_DIRECTIVES):
|
||||
block.append(directive)
|
||||
block.append(COMMENT)
|
||||
elif block[location][1] != directive_value:
|
||||
raise errors.MisconfigurationError(
|
||||
'tried to insert directive "{0}" but found '
|
||||
|
|
|
|||
Loading…
Reference in a new issue