
­­­­­­­­­­­­­­­­­­
<!DOCTYPE html>
<html>
3
\me
              	   @   s   U d Z ddlZddlmZ ddlmZ ddlmZ ddlm	Z	 ddl
mZmZ ddlmZ ejeZeZd	d
gZdZdZdddedeedddgdgdZeeeZ ee	eeddddZdd ZdS )z)Apt Pipelining: configure apt pipelining.    N)dedent)util)Cloud)Config)
MetaSchemaget_meta_doc)PER_INSTANCEZubuntuZdebianz+/etc/apt/apt.conf.d/90cloud-init-pipeliningzQ//Written by cloud-init per 'apt_pipelining'
Acquire::http::Pipeline-Depth "%s";
Zcc_apt_pipeliningzApt PipeliningzConfigure apt pipelininga          This module configures apt's ``Acquite::http::Pipeline-Depth`` option,
        which controls how apt handles HTTP pipelining. It may be useful for
        pipelining to be disabled, because some web servers, such as S3 do not
        pipeline properly (LP: #948461).

        Value configuration options for this module are:

        * ``os``: (Default) use distro default
        * ``false`` disable pipelining altogether
        * ``<number>``: Manually specify pipeline depth. This is not recommended.zapt_pipelining: falsezapt_pipelining: oszapt_pipelining: 3apt_pipelining)idnametitledescriptiondistros	frequencyZexamplesZactivate_by_schema_keys)r   cfgcloudargsreturnc             C   st   |j dd}t|j j }|dkr2tdtt n>|dkr>d S |dd td	d
D krdt|tt ntjd| d S )Nr	   osZfalse0none	unchangedc             S   s   g | ]}t |qS  )str).0br   r   '/usr/lib/python3.6/cc_apt_pipelining.py
<listcomp>F   s    zhandle.<locals>.<listcomp>r      z%Invalid option for apt_pipelining: %s)r   r   r   )	getr   lowerstripwrite_apt_snippetLOGDEFAULT_FILErangeZwarning)r   r   r   r   Zapt_pipe_valueZapt_pipe_value_sr   r   r   handle>   s    r&   c             C   s&   t |  }tj|| |jd||  dS )z0Writes f_name with apt pipeline depth 'setting'.z+Wrote %s with apt pipeline depth setting %sN)APT_PIPE_TPLr   Z
write_filedebug)ZsettinglogZf_nameZfile_contentsr   r   r   r"   L   s    r"   )__doc__Zloggingtextwrapr   Z	cloudinitr   Zcloudinit.cloudr   Zcloudinit.configr   Zcloudinit.config.schemar   r   Zcloudinit.settingsr   Z	getLogger__name__r#   r   r   r$   r'   metar   listr&   r"   r   r   r   r   <module>   s4   
	