'Adds NameVirtualHost directive for given address.
:param addr: Address that will be added as NameVirtualHost directive
:type addr: :class:`~certbot_apache.obj.Addr`'

def add_name_vhost(self, addr):

    loc = parser.get_aug_path(self.parser.loc['name'])
    if (addr.get_port() == '443'):
        path = self.parser.add_dir_to_ifmodssl(loc, 'NameVirtualHost', [str(addr)])
    else:
        path = self.parser.add_dir(loc, 'NameVirtualHost', [str(addr)])
    msg = ('Setting    %s    to    be    NameBasedVirtualHost\n DCTB Directive    added    to    %s\n' % (addr, path))
    logger.debug(msg)
    self.save_notes += msg
