mirror of
https://github.com/certbot/certbot.git
synced 2026-08-01 02:35:06 +02:00
Normalize plugins.common.dest_namespace (fixes #689).
This commit is contained in:
@@ -20,7 +20,7 @@ def option_namespace(name):
|
|||||||
|
|
||||||
def dest_namespace(name):
|
def dest_namespace(name):
|
||||||
"""ArgumentParser dest namespace (prefix of all destinations)."""
|
"""ArgumentParser dest namespace (prefix of all destinations)."""
|
||||||
return name + "_"
|
return name.replace("-", "_") + "_"
|
||||||
|
|
||||||
private_ips_regex = re.compile( # pylint: disable=invalid-name
|
private_ips_regex = re.compile( # pylint: disable=invalid-name
|
||||||
r"(^127\.0\.0\.1)|(^10\.)|(^172\.1[6-9]\.)|"
|
r"(^127\.0\.0\.1)|(^10\.)|(^172\.1[6-9]\.)|"
|
||||||
|
|||||||
@@ -23,6 +23,10 @@ class NamespaceFunctionsTest(unittest.TestCase):
|
|||||||
from letsencrypt.plugins.common import dest_namespace
|
from letsencrypt.plugins.common import dest_namespace
|
||||||
self.assertEqual("foo_", dest_namespace("foo"))
|
self.assertEqual("foo_", dest_namespace("foo"))
|
||||||
|
|
||||||
|
def test_dest_namespace_with_dashes(self):
|
||||||
|
from letsencrypt.plugins.common import dest_namespace
|
||||||
|
self.assertEqual("foo_bar_", dest_namespace("foo-bar"))
|
||||||
|
|
||||||
|
|
||||||
class PluginTest(unittest.TestCase):
|
class PluginTest(unittest.TestCase):
|
||||||
"""Test for letsencrypt.plugins.common.Plugin."""
|
"""Test for letsencrypt.plugins.common.Plugin."""
|
||||||
|
|||||||
Reference in New Issue
Block a user