mirror of
https://github.com/certbot/certbot.git
synced 2026-06-08 00:02:14 -04:00
Implement get_all_names.
This commit is contained in:
parent
fee9c86233
commit
fd1cef3fa0
2 changed files with 10 additions and 1 deletions
|
|
@ -171,6 +171,15 @@ class PostfixConfigGenerator:
|
|||
"""Returns all names that may be authenticated.
|
||||
:rtype: `list` of `str`
|
||||
"""
|
||||
var_names = ('myhostname', 'mydomain', 'myorigin')
|
||||
names_found = set()
|
||||
for num, line in enumerate(self.cf):
|
||||
num, found_var, found_value = parse_line((num, line))
|
||||
if found_var in var_names:
|
||||
names_found.add(found_value)
|
||||
name_list = list(names_found)
|
||||
name_list.sort()
|
||||
return name_list
|
||||
|
||||
def deploy_cert(self, domain, _cert_path, key_path, _chain_path, fullchain_path):
|
||||
"""Deploy certificate.
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ class TestPostfixConfigGenerator(unittest.TestCase):
|
|||
pass
|
||||
|
||||
def testGetAllNames(self):
|
||||
sorted_names = ('fubard.org', 'mail.fubard.org')
|
||||
sorted_names = ['fubard.org', 'mail.fubard.org']
|
||||
postfix_config_gen = pcg.PostfixConfigGenerator(
|
||||
self.config,
|
||||
self.postfix_dir,
|
||||
|
|
|
|||
Loading…
Reference in a new issue