From aa33c0fa83fd7230af457074d4142fb29c452588 Mon Sep 17 00:00:00 2001 From: Brad Warren Date: Mon, 18 Jul 2016 15:33:28 -0700 Subject: [PATCH] does it work? --- certbot-nginx/certbot_nginx/parser.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/certbot-nginx/certbot_nginx/parser.py b/certbot-nginx/certbot_nginx/parser.py index cd256d0c4..5350e04d7 100644 --- a/certbot-nginx/certbot_nginx/parser.py +++ b/certbot-nginx/certbot_nginx/parser.py @@ -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 '