def do_update(self, node_role_map, node_roles, first_run=False):
        require('use_rds')
        require('pstat_instance')
        require('pstat_url')
        require('project_root')
        require('config_folder')
        require('ssl_prefix')
        require('backup')
        require('aws_access_key_id')
        require('aws_secret_access_key')
        require('sphinx_counter')
        require('key_filename')
        require('calabar_conf_context')
        require('loggly_inputs')
        require('sphinx_counter')
        require('ipsec_confs')
        require('hostname')
        require('enable_periodic_tasks')

        logger.info("Starting to provision %s", env.host_string)

        for ipsec_name, _ in env.ipsec_confs.items():
            # Require all of the pre-shared key configs
            require('ipsec_psk_%s' % ipsec_name)

        if first_run:
            self.do_first_launch_config()

        self._stop_celery()

        self._update_cache_settings(node_role_map['memcached']['all'])
        self._update_sphinx_settings(
            node_role_map['celery_backend']['same_az'],
            node_roles,
        )
        self._update_celery_backend_settings(
            node_role_map['sphinx_search_indexer']['same_az'],
        )
        ldap_api_nodes = node_role_map['has_ldap_access']
        self._update_ldap_api_endpoint_settings(
            all_ldap_api_nodes=ldap_api_nodes['all'],
            same_az_ldap_api_nodes=ldap_api_nodes['same_az'],
            node_roles=node_roles,
        )
        self._update_celery_ldap_settings(node_roles)

        # Package and push the app to the new instance
        env.project_root_src = '/opt/pstat/versions/%(timestamp)s' % env
        source_dir = env.project_root_src
        current_source_dir = None
        if not first_run:
            current_source_dir = env.project_root
        with hide(*fab_output_hides):
            push_source(
                new_source_dir=source_dir,
                current_source_dir=current_source_dir,
                chown=F_CHOWN,
                chmod="u+rw,g+rw,o-rw",
            )
        self._make_media_readable(source_dir)
        self._configure_settings_local(
            source_dir,
            env.pstat_settings,
            chown=F_CHOWN,
        )
        self._configure_settings_target(
            source_dir,
            env.settings_target,
            chown=F_CHOWN,
        )
        self.configure_terrarium(source_dir=source_dir, user=FILE_OWNER)
        self._activate_new_source(
            source_dir,
            [ACTIVE_SOURCE_SYMLINK, env.project_root],
        )
        self._run_db_migrations(user=FILE_OWNER)

        # Link up the attachments and upload directories from /mnt/
        self._link_storage_dirs()

        self._configure_webservers(node_roles)
        building_search_index = self._build_search_index()

        self._create_media_folder()
        self._collect_static_media()

        self._create_500_page()
        self._restart_webservers()

        # Services managed via supervisord
        self._configure_celery(node_roles)
        self._update_supervisord()
        self._configure_calabar()
        self._configure_ipsec()
        self._start_celery()

        self._configure_loggly()
        self._configure_pstat_cron_jobs()
        self._configure_email_sending()

        if first_run:
            self._sync_s3_media()

        if building_search_index:
            self._wait_for_search_indexing()
        self._ensure_sphinx_running()
        self._configure_sphinx_cron()

        logger.info("Provisioner completed successfully")
default: django-admin builtin commands fail if settings file (from argument) doesn't exist
dataset/ETHPy150Open winhamwr/neckbeard/neckbeard/brain_wrinkles/pstat/app.py/AppServerProvisioner.do_update--crossover with--dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.4/tests/regressiontests/admin_scripts/tests.py/DjangoAdminDefaultSettings.test_builtin_with_bad_settings