
    f
              
           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g ddgdZeed<    ee      Z dede	dededdf
dZd Zy)z)Apt Pipelining: configure apt pipelining.    N)dedent)util)Cloud)Config)
MetaSchemaget_meta_doc)PER_INSTANCEubuntudebianz+/etc/apt/apt.conf.d/90cloud-init-pipeliningzQ//Written by cloud-init per 'apt_pipelining'
Acquire::http::Pipeline-Depth "%s";
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	frequencyexamplesactivate_by_schema_keysmetar   cfgcloudargsreturnc                 `   |j                  dd      }t        |      j                         j                         }|dk(  rt	        dt
        t               y |dv ry |t        d      D cg c]  }t        |       c}v rt	        |t
        t               y t
        j                  d|       y c c}w )Nr   osfalse0)none	unchangedr      z%Invalid option for apt_pipelining: %s)	getstrlowerstripwrite_apt_snippetLOGDEFAULT_FILErangewarning)r   r   r   r   apt_pipe_valueapt_pipe_value_sbs          D/usr/lib/python3/dist-packages/cloudinit/config/cc_apt_pipelining.pyhandler/   >   s    WW-t4N>*00288:7"#sL1	8	8	eAh7c!f7	7*C>;^L 8s   (B+c                 h    t         | z  }t        j                  ||       |j                  d||        y)z0Writes f_name with apt pipeline depth 'setting'.z+Wrote %s with apt pipeline depth setting %sN)APT_PIPE_TPLr   
write_filedebug)settinglogf_namefile_contentss       r.   r&   r&   L   s-     !G,MOOFM*II;VWM    )__doc__loggingtextwrapr   	cloudinitr   cloudinit.cloudr   cloudinit.configr   cloudinit.config.schemar   r   cloudinit.settingsr	   	getLogger__name__r'   r   r   r(   r1   r   __annotations__r#   listr/   r&    r8   r.   <module>rF      s    0    ! # < +g!	X
<,  '
	U 
 !111j 6 t
M M6 M% Mt M MNr8   