From ed4fc9d2f73631b9fa57f111ac1ee51a7f0fd4c6 Mon Sep 17 00:00:00 2001 From: Brad Warren Date: Mon, 18 Jul 2016 18:20:21 -0700 Subject: [PATCH] call _comment_directive --- certbot-nginx/certbot_nginx/parser.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/certbot-nginx/certbot_nginx/parser.py b/certbot-nginx/certbot_nginx/parser.py index e8fd50452..a79136836 100644 --- a/certbot-nginx/certbot_nginx/parser.py +++ b/certbot-nginx/certbot_nginx/parser.py @@ -566,7 +566,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) + _comment_directive(block, location) 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 @@ -576,7 +576,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) + _comment_directive(block, len(block)) elif block[location][1] != directive_value: raise errors.MisconfigurationError( 'tried to insert directive "{0}" but found '