mirror of
https://github.com/certbot/certbot.git
synced 2026-08-01 02:44:21 +02:00
Fix lint problems with long lines
This commit is contained in:
@@ -213,7 +213,9 @@ class NginxParser(object):
|
|||||||
except IOError:
|
except IOError:
|
||||||
logger.warning("Could not open file: %s", item)
|
logger.warning("Could not open file: %s", item)
|
||||||
except UnicodeDecodeError:
|
except UnicodeDecodeError:
|
||||||
logger.warning("Could not read file: %s due to invalid unicode character. Only UTF-8 encoding is supported.", item)
|
logger.warning("Could not read file: %s due to invalid "
|
||||||
|
"character. Only UTF-8 encoding is "
|
||||||
|
"supported.", item)
|
||||||
except pyparsing.ParseException as err:
|
except pyparsing.ParseException as err:
|
||||||
logger.debug("Could not parse file: %s due to %s", item, err)
|
logger.debug("Could not parse file: %s due to %s", item, err)
|
||||||
return trees
|
return trees
|
||||||
@@ -422,7 +424,8 @@ def _parse_ssl_options(ssl_options):
|
|||||||
except IOError:
|
except IOError:
|
||||||
logger.warning("Missing NGINX TLS options file: %s", ssl_options)
|
logger.warning("Missing NGINX TLS options file: %s", ssl_options)
|
||||||
except UnicodeDecodeError:
|
except UnicodeDecodeError:
|
||||||
logger.warn("Could not read file: %s due to invalid unicode character. Only UTF-8 encoding is supported.", ssl_options)
|
logger.warn("Could not read file: %s due to invalid character. "
|
||||||
|
"Only UTF-8 encoding is supported.", ssl_options)
|
||||||
except pyparsing.ParseBaseException as err:
|
except pyparsing.ParseBaseException as err:
|
||||||
logger.debug("Could not parse file: %s due to %s", ssl_options, err)
|
logger.debug("Could not parse file: %s due to %s", ssl_options, err)
|
||||||
return []
|
return []
|
||||||
|
|||||||
@@ -485,14 +485,16 @@ class NginxParserTest(util.NginxTest):
|
|||||||
def test_valid_unicode_characters(self):
|
def test_valid_unicode_characters(self):
|
||||||
nparser = parser.NginxParser(self.config_path)
|
nparser = parser.NginxParser(self.config_path)
|
||||||
# pylint: disable=protected-access
|
# pylint: disable=protected-access
|
||||||
parsed = nparser._parse_files(nparser.abs_path('unicode_support/valid_unicode_comments.conf'))
|
path = nparser.abs_path('unicode_support/valid_unicode_comments.conf')
|
||||||
|
parsed = nparser._parse_files(path)
|
||||||
self.assertEqual(['server'], parsed[0][2][0])
|
self.assertEqual(['server'], parsed[0][2][0])
|
||||||
self.assertEqual(['listen', '80'], parsed[0][2][1][3])
|
self.assertEqual(['listen', '80'], parsed[0][2][1][3])
|
||||||
|
|
||||||
def test_invalid_unicode_characters(self):
|
def test_invalid_unicode_characters(self):
|
||||||
nparser = parser.NginxParser(self.config_path)
|
nparser = parser.NginxParser(self.config_path)
|
||||||
# pylint: disable=protected-access
|
# pylint: disable=protected-access
|
||||||
parsed = nparser._parse_files(nparser.abs_path('unicode_support/invalid_unicode_comments.conf'))
|
path = nparser.abs_path('unicode_support/invalid_unicode_comments.conf')
|
||||||
|
parsed = nparser._parse_files(path)
|
||||||
self.assertEqual([], parsed)
|
self.assertEqual([], parsed)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user