PEP8 & linter love

This commit is contained in:
Joona Hoikkala 2015-12-07 13:37:58 +02:00
parent 718a6481f1
commit 47eb7d76cd
4 changed files with 7 additions and 5 deletions

View file

@ -104,7 +104,7 @@ class ApacheConfigurator(augeas_configurator.AugeasConfigurator):
default=constants.os_constant("challenge_location"),
help="Directory path for challenge configuration.")
add("handle-modules", default=constants.os_constant("handle_mods"),
help="Let installer handle enabling required modules for you."+
help="Let installer handle enabling required modules for you." +
"(Only Ubuntu/Debian currently)")
le_util.add_deprecated_argument(add, "init-script", 1)

View file

@ -60,6 +60,7 @@ UIR_ARGS = ["always", "set", "Content-Security-Policy",
HEADER_ARGS = {"Strict-Transport-Security": HSTS_ARGS,
"Upgrade-Insecure-Requests": UIR_ARGS}
def os_constant(key):
"""Get a constant value for operating system
:param key: name of cli constant

View file

@ -64,7 +64,6 @@ class ApacheParser(object):
# Must also attempt to parse virtual host root
self._parse_file(self.vhostroot + "/*.conf")
def init_modules(self):
"""Iterates on the configuration until no new modules are loaded.

View file

@ -1,3 +1,5 @@
"""Test for letsencrypt_apache.configurator."""
import mock
import unittest
@ -8,15 +10,15 @@ class ConstantsTest(unittest.TestCase):
@mock.patch("letsencrypt.le_util.get_os_info")
def test_get_debian_value(self, os_info):
os_info.return_value = ('Debian','','')
os_info.return_value = ('Debian', '', '')
self.assertEqual(constants.os_constant("ctl"), "apache2ctl")
@mock.patch("letsencrypt.le_util.get_os_info")
def test_get_centos_value(self, os_info):
os_info.return_value = ('CentOS Linux','','')
os_info.return_value = ('CentOS Linux', '', '')
self.assertEqual(constants.os_constant("ctl"), "apachectl")
@mock.patch("letsencrypt.le_util.get_os_info")
def test_get_default_value(self, os_info):
os_info.return_value = ('Nonexistent Linux','','')
os_info.return_value = ('Nonexistent Linux', '', '')
self.assertEqual(constants.os_constant("ctl"), "apache2ctl")