def env_vars_from_env_config(env_config):
    """Generate a dict suitable for updating os.environ to reflect app config.

    This function only returns a dict and does not update os.environ directly.

    Args:
        env_config: The app configuration as generated by
            vmconfig.BuildVmAppengineEnvConfig()

    Returns:
        A dict of strings suitable for e.g. `os.environ.update(values)`.
    """

    return {
        'SERVER_SOFTWARE': env_config.server_software,
        'APPENGINE_RUNTIME': 'python27',
        'APPLICATION_ID': '%s~%s' % (env_config.partition, env_config.appid),
        'INSTANCE_ID': env_config.instance,
        'BACKEND_ID': env_config.major_version,
        'CURRENT_MODULE_ID': env_config.module,
        'CURRENT_VERSION_ID': '%s.%s' % (env_config.major_version,
                                         env_config.minor_version),
        'DEFAULT_TICKET': env_config.default_ticket,
    }