def _configure_webservers(self, node_roles):
        logger.info("Configuring uwsgi")
        with hide(*fab_quiet):
            # Configure the uwsgi app
            context = {
                'project_root': env.project_root,
                'domain': env.pstat_url,
            }
            upload_template(
                '../config/tpl/newrelic/policystat.ini',
                '/etc/newrelic/policystat.ini',
                context,
                use_sudo=True
            )
            upload_template(
                '../config/tpl/uwsgi/policystat.yaml',
                '/etc/uwsgi/policystat.yaml',
                context,
                use_sudo=True
            )

            # Configure the supervisord config for uwsgi
            newrelic_conf = self.conf.get('newrelic', {})
            new_relic_environment = newrelic_conf.get('environment', None)
            context = {
                'new_relic_environment': new_relic_environment,
            }
            changed = upload_template_changed(
                '../config/tpl/uwsgi/etc/supervisor/conf.d/uwsgi.conf',
                '/etc/supervisor/conf.d/uwsgi.conf',
                use_sudo=True,
                mode=0600,
                use_jinja=True,
                context=context,
            )
            if changed:
                self.modified_services.append(SUPERVISORD)

            # Give user policystat access to configuration files
            files = [
                '/etc/uwsgi/policystat.yaml',
                '/etc/newrelic/policystat.ini',
            ]
            sudo('chown %s %s' % (F_CHOWN, ' '.join(files)))

            logger.info("Configuring nginx")
            # Configure the nginx host
            context = {
                'project_root': env.project_root,
                'domain': env.pstat_url,
            }
            upload_template(
                '../config/tpl/nginx/pstat',
                '/etc/nginx/sites-available/%s' % env.pstat_url,
                context,
                use_sudo=True,
            )

            # Make sure no other sites are enabled
            sudo('rm -f /etc/nginx/sites-enabled/*')

            # Enable our site
            sudo(
                'ln -s '
                '/etc/nginx/sites-available/%(pstat_url)s '
                '/etc/nginx/sites-enabled/%(pstat_url)s' % env
            )
Run all tests.
dataset/ETHPy150Open winhamwr/neckbeard/neckbeard/brain_wrinkles/pstat/app.py/AppServerProvisioner._configure_webservers--crossover with--dataset/ETHPy150Open LabPy/lantz/lantz/__init__.py/test