'Deploys certificate to specified virtual host.
.. note:: Aborts if the vhost is missing ssl_certificate or
ssl_certificate_key.
.. note:: This doesn\'t save the config files!
:raises errors.PluginError: When unable to deploy certificate due to
a lack of directives or configuration'

def deploy_cert(self, domain, cert_path, key_path, chain_path=None, fullchain_path=None):

    if (not fullchain_path):
        raise errors.PluginError('The    nginx    plugin    currently    requires    --fullchain-path    to    install    a    cert.')
    vhost = self.choose_vhost(domain)
    cert_directives = [['\n', 'ssl_certificate', '    ', fullchain_path], ['\n', 'ssl_certificate_key', '    ', key_path]]
    self.parser.add_server_directives(vhost, cert_directives, replace=True)
    logger.info('Deployed    Certificate    to    VirtualHost    %s    for    %s', vhost.filep, vhost.names)
    self.save_notes += ('Changed    vhost    at    %s    with    addresses    of    %s\n' % (vhost.filep, ',    '.join((str(addr) for addr in vhost.addrs))))
    self.save_notes += (' DCTB ssl_certificate    %s\n' % fullchain_path)
    self.save_notes += (' DCTB ssl_certificate_key    %s\n' % key_path)
