mirror of
https://github.com/certbot/certbot.git
synced 2026-07-28 08:45:22 +02:00
lintmonster
This commit is contained in:
+2
-2
@@ -1036,7 +1036,7 @@ def _plugins_parsing(helpful, plugins):
|
||||
# "webroot" topic
|
||||
helpful.add("webroot", "-w", "--webroot-path", action=WebrootPathProcessor,
|
||||
help="public_html / webroot path")
|
||||
parse_dict = lambda s : dict(json.loads(s))
|
||||
parse_dict = lambda s: dict(json.loads(s))
|
||||
helpful.add("webroot", "--webroot-map", default={}, type=parse_dict,
|
||||
help="Mapping from domains to webroot paths")
|
||||
|
||||
@@ -1068,7 +1068,7 @@ class DomainFlagProcessor(argparse.Action): # pylint: disable=missing-docstring
|
||||
if not config.domains:
|
||||
config.domains = []
|
||||
|
||||
for d in map(string.strip, domain_arg.split(",")):
|
||||
for d in map(string.strip, domain_arg.split(",")): # pylint: disable=bad-builtin
|
||||
if d not in config.domains:
|
||||
config.domains.append(d)
|
||||
# Each domain has a webroot_path of the most recent -w flag
|
||||
|
||||
@@ -32,7 +32,7 @@ class AuthenticatorTest(unittest.TestCase):
|
||||
self.path, ".well-known", "acme-challenge",
|
||||
"ZXZhR3hmQURzNnBTUmIyTEF2OUlaZjE3RHQzanV4R0orUEN0OTJ3citvQQ")
|
||||
self.config = mock.MagicMock(webroot_path=self.path,
|
||||
webroot_map={"thing.com":self.path})
|
||||
webroot_map={"thing.com": self.path})
|
||||
self.auth = Authenticator(self.config, "webroot")
|
||||
self.auth.prepare()
|
||||
|
||||
|
||||
@@ -348,15 +348,15 @@ class CLITest(unittest.TestCase): # pylint: disable=too-many-public-methods
|
||||
'/var/www/superfluous', '-d', 'superfluo.us', '-d', 'www.superfluo.us']
|
||||
namespace = cli.prepare_and_parse_args(plugins, webroot_args)
|
||||
self.assertEqual(namespace.webroot_map, {
|
||||
'example.com' : '/var/www/example',
|
||||
'stray.example.com' : '/var/www/example',
|
||||
'www.example.com' : '/var/www/example',
|
||||
'www.superfluo.us' : '/var/www/superfluous',
|
||||
'superfluo.us' : '/var/www/superfluous'})
|
||||
'example.com': '/var/www/example',
|
||||
'stray.example.com': '/var/www/example',
|
||||
'www.example.com': '/var/www/example',
|
||||
'www.superfluo.us': '/var/www/superfluous',
|
||||
'superfluo.us': '/var/www/superfluous'})
|
||||
|
||||
webroot_map_args = ['--webroot-map', '{"eg.com" : "/tmp"}']
|
||||
namespace = cli.prepare_and_parse_args(plugins, webroot_map_args)
|
||||
self.assertEqual(namespace.webroot_map, {u"eg.com" : u"/tmp"})
|
||||
self.assertEqual(namespace.webroot_map, {u"eg.com": u"/tmp"})
|
||||
|
||||
@mock.patch('letsencrypt.crypto_util.notAfter')
|
||||
@mock.patch('letsencrypt.cli.zope.component.getUtility')
|
||||
|
||||
Reference in New Issue
Block a user