nginx plugin requires fullchain_path

This commit is contained in:
Reinaldo de Souza Jr 2016-01-04 15:02:15 -05:00
parent 74237d1010
commit e8fc2eca01
2 changed files with 13 additions and 0 deletions

View file

@ -140,6 +140,10 @@ class NginxConfigurator(common.Plugin):
a lack of directives or configuration
"""
if not fullchain_path:
raise errors.PluginError(
"--fullchain-path is required for nginx plugin.")
vhost = self.choose_vhost(domain)
cert_directives = [['ssl_certificate', fullchain_path],
['ssl_certificate_key', key_path]]

View file

@ -134,6 +134,15 @@ class NginxConfiguratorTest(util.NginxTest):
None,
"example/fullchain.pem")
def test_deploy_cert_requires_fullchain_path(self):
self.config.version = (1, 3, 1)
self.assertRaises(errors.PluginError, self.config.deploy_cert,
"www.example.com",
"example/cert.pem",
"example/key.pem",
"example/chain.pem",
None)
def test_deploy_cert(self):
server_conf = self.config.parser.abs_path('server.conf')
nginx_conf = self.config.parser.abs_path('nginx.conf')