Merge branch 'master' into reverter

Conflicts:
	letsencrypt/client/augeas_configurator.py
This commit is contained in:
James Kasten 2015-01-25 04:28:09 -08:00
commit 4ad01f07f7
10 changed files with 41 additions and 34 deletions

View file

@ -72,7 +72,11 @@ style](#coding-style)**. The following tools are there to help you:
## Documentation
In order to generate the sphinx documentation, run the following commands.
The official documentation is available at
https://letsencrypt.readthedocs.org.
In order to generate the Sphinx documentation, run the following
commands.
```
./venv/bin/python setup.py docs
@ -80,7 +84,7 @@ cd docs
make clean html SPHINXBUILD=../venv/bin/sphinx-build
```
This should generate documentation in the /lets-encrypt-preview/docs/_build/html
This should generate documentation in the `docs/_build/html`
directory.
### Coding style

View file

@ -338,9 +338,8 @@ class ApacheConfigurator(augeas_configurator.AugeasConfigurator):
return vhs
# pylint: disable=anomalous-backslash-in-string
def is_name_vhost(self, target_addr):
"""Returns if vhost is a name based vhost
r"""Returns if vhost is a name based vhost
NameVirtualHost was deprecated in Apache 2.4 as all VirtualHosts are
now NameVirtualHosts. If version is earlier than 2.4, check if addr
@ -958,10 +957,8 @@ class ApacheConfigurator(augeas_configurator.AugeasConfigurator):
###########################################################################
# Challenges Section
###########################################################################
# pylint: disable=no-self-use, unused-argument
def get_chall_pref(self, domain):
def get_chall_pref(self, unused_domain): # pylint: disable=no-self-use
"""Return list of challenge preferences."""
return ["dvsni"]
def perform(self, chall_list):

View file

@ -43,8 +43,7 @@ class Addr(object):
return self.__class__((self.tup[0], port))
# pylint: disable=too-few-public-methods
class VirtualHost(object):
class VirtualHost(object): # pylint: disable=too-few-public-methods
"""Represents an Apache Virtualhost.
:ivar str filep: file path of VH
@ -58,7 +57,8 @@ class VirtualHost(object):
"""
def __init__(self, filep, path, addrs, ssl, enabled, names=None): # pylint: disable=too-many-arguments
def __init__(self, filep, path, addrs, ssl, enabled, names=None):
# pylint: disable=too-many-arguments
"""Initialize a VH."""
self.filep = filep
self.path = path

View file

@ -144,8 +144,8 @@ class Client(object):
return self.network.send_and_receive_expected(
acme.certificate_request(csr_der, self.authkey.pem), "certificate")
# pylint: disable=no-self-use
def save_certificate(self, certificate_dict, cert_path, chain_path):
# pylint: disable=no-self-use
"""Saves the certificate received from the ACME server.
:param dict certificate_dict: certificate message from server

View file

@ -25,8 +25,7 @@ class ClientAuthenticator(object):
"""
self.rec_token = recovery_token.RecoveryToken(server)
# pylint: disable=unused-argument,no-self-use
def get_chall_pref(self, domain):
def get_chall_pref(self, unused_domain): # pylint: disable=no-self-use
"""Return list of challenge preferences."""
return ["recoveryToken"]

View file

@ -42,10 +42,12 @@ class NcursesDisplay(CommonDisplayMixin):
self.width = width
self.height = height
def generic_notification(self, message): # pylint: disable=missing-docstring
def generic_notification(self, message):
# pylint: disable=missing-docstring
self.dialog.msgbox(message, width=self.width)
def generic_menu(self, message, choices, unused_input_text=""): # pylint: disable=missing-docstring
def generic_menu(self, message, choices, unused_input_text=""):
# pylint: disable=missing-docstring
# Can accept either tuples or just the actual choices
if choices and isinstance(choices[0], tuple):
code, selection = self.dialog.menu(
@ -61,7 +63,8 @@ class NcursesDisplay(CommonDisplayMixin):
def generic_input(self, message): # pylint: disable=missing-docstring
return self.dialog.inputbox(message)
def generic_yesno(self, message, yes_label="Yes", no_label="No"): # pylint: disable=missing-docstring
def generic_yesno(self, message, yes_label="Yes", no_label="No"):
# pylint: disable=missing-docstring
return self.dialog.DIALOG_OK == self.dialog.yesno(
message, self.height, self.width,
yes_label=yes_label, no_label=no_label)
@ -73,7 +76,8 @@ class NcursesDisplay(CommonDisplayMixin):
choices=choices)
return code, [str(s) for s in names]
def success_installation(self, domains): # pylint: disable=missing-docstring
def success_installation(self, domains):
# pylint: disable=missing-docstring
self.dialog.msgbox(
"\nCongratulations! You have successfully enabled "
+ gen_https_names(domains) + "!", width=self.width)
@ -127,13 +131,15 @@ class FileDisplay(CommonDisplayMixin):
super(FileDisplay, self).__init__()
self.outfile = outfile
def generic_notification(self, message): # pylint: disable=missing-docstring
def generic_notification(self, message):
# pylint: disable=missing-docstring
side_frame = '-' * 79
msg = textwrap.fill(message, 80)
self.outfile.write("\n%s\n%s\n%s\n" % (side_frame, msg, side_frame))
raw_input("Press Enter to Continue")
def generic_menu(self, message, choices, input_text=""): # pylint: disable=missing-docstring
def generic_menu(self, message, choices, input_text=""):
# pylint: disable=missing-docstring
# Can take either tuples or single items in choices list
if choices and isinstance(choices[0], tuple):
choices = ["%s - %s" % (c[0], c[1]) for c in choices]
@ -153,7 +159,8 @@ class FileDisplay(CommonDisplayMixin):
return code, (selection - 1)
def generic_input(self, message): # pylint: disable=no-self-use,missing-docstring
def generic_input(self, message):
# pylint: disable=no-self-use,missing-docstring
ans = raw_input("%s (Enter c to cancel)\n" % message)
if ans.startswith('c') or ans.startswith('C'):
@ -161,7 +168,8 @@ class FileDisplay(CommonDisplayMixin):
else:
return OK, ans
def generic_yesno(self, message, unused_yes_label="", unused_no_label=""): # pylint: disable=missing-docstring
def generic_yesno(self, message, unused_yes_label="", unused_no_label=""):
# pylint: disable=missing-docstring
self.outfile.write("\n%s\n" % textwrap.fill(message, 80))
ans = raw_input("y/n: ")
return ans.startswith('y') or ans.startswith('Y')
@ -211,7 +219,8 @@ class FileDisplay(CommonDisplayMixin):
return code, selection
def success_installation(self, domains): # pylint: disable=missing-docstring
def success_installation(self, domains):
# pylint: disable=missing-docstring
side_frame = '*' * 79
msg = textwrap.fill("Congratulations! You have successfully "
"enabled %s!" % gen_https_names(domains))

View file

@ -118,8 +118,7 @@ class Revoker(object):
else:
exit(0)
# pylint: disable=no-self-use
def remove_cert_key(self, cert):
def remove_cert_key(self, cert): # pylint: disable=no-self-use
"""Remove certificate and key.
:param dict cert: Cert dict used throughout revocation

View file

@ -42,8 +42,7 @@ class ApacheParserTest(util.ApacheTest):
file_path = os.path.join(
self.config_path, "sites-available", "letsencrypt.conf")
# pylint: disable=protected-access
self.parser._parse_file(file_path)
self.parser._parse_file(file_path) # pylint: disable=protected-access
# search for the httpd incl
matches = self.parser.aug.match(

View file

@ -17,7 +17,6 @@ TRANSLATE = {
}
# pylint: disable=protected-access
class SatisfyChallengesTest(unittest.TestCase):
"""verify_identities test."""
@ -42,7 +41,7 @@ class SatisfyChallengesTest(unittest.TestCase):
msg = acme_util.get_chall_msg(dom, "nonce0", challenge)
self.handler.add_chall_msg(dom, msg, "dummy_key")
self.handler._satisfy_challenges()
self.handler._satisfy_challenges() # pylint: disable=protected-access
self.assertEqual(len(self.handler.responses), 1)
self.assertEqual(len(self.handler.responses[dom]), 1)
@ -61,7 +60,7 @@ class SatisfyChallengesTest(unittest.TestCase):
acme_util.get_chall_msg(str(i), "nonce%d" % i, challenge),
"dummy_key")
self.handler._satisfy_challenges()
self.handler._satisfy_challenges() # pylint: disable=protected-access
self.assertEqual(len(self.handler.responses), 5)
self.assertEqual(len(self.handler.dv_c), 5)
@ -90,7 +89,7 @@ class SatisfyChallengesTest(unittest.TestCase):
path = gen_path(["simpleHttps"], challenges)
mock_chall_path.return_value = path
self.handler._satisfy_challenges()
self.handler._satisfy_challenges() # pylint: disable=protected-access
self.assertEqual(len(self.handler.responses), 1)
self.assertEqual(len(self.handler.responses[dom]), len(challenges))
@ -120,7 +119,7 @@ class SatisfyChallengesTest(unittest.TestCase):
path = gen_path(["simpleHttps", "recoveryToken"], challenges)
mock_chall_path.return_value = path
self.handler._satisfy_challenges()
self.handler._satisfy_challenges() # pylint: disable=protected-access
self.assertEqual(len(self.handler.responses), 1)
self.assertEqual(len(self.handler.responses[dom]), len(challenges))
@ -151,7 +150,7 @@ class SatisfyChallengesTest(unittest.TestCase):
path = gen_path(["dvsni", "recoveryContact"], challenges)
mock_chall_path.return_value = path
self.handler._satisfy_challenges()
self.handler._satisfy_challenges() # pylint: disable=protected-access
self.assertEqual(len(self.handler.responses), 5)
for i in range(5):
@ -200,7 +199,7 @@ class SatisfyChallengesTest(unittest.TestCase):
mock_chall_path.side_effect = paths
self.handler._satisfy_challenges()
self.handler._satisfy_challenges() # pylint: disable=protected-access
self.assertEqual(len(self.handler.responses), 5)
self.assertEqual(len(self.handler.dv_c), 5)

View file

@ -12,8 +12,9 @@ from letsencrypt.client import client
from letsencrypt.client import CONFIG
from letsencrypt.client import le_util
# pylint: disable=too-few-public-methods
class DvsniGenCertTest(unittest.TestCase):
# pylint: disable=too-few-public-methods
"""Tests for letsencrypt.client.challenge_util.dvsni_gen_cert."""
def test_standard(self):