3 \�me� � @ s� U d Z ddlZddlmZ ddlmZ ddlmZ ddlm Z ddl mZmZ ddl mZ eje�ZeZd d gZdZdZd dded�eedddgdgd�Zeee�Z ee eedd�dd�Zdd� ZdS )z)Apt Pipelining: configure apt pipelining.� N)�dedent)�util)�Cloud)�Config)� MetaSchema�get_meta_doc)�PER_INSTANCEZubuntuZdebianz+/etc/apt/apt.conf.d/90cloud-init-pipeliningzQ//Written by cloud-init per 'apt_pipelining' Acquire::http::Pipeline-Depth "%s"; Zcc_apt_pipeliningzApt PipeliningzConfigure 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.zapt_pipelining: falsezapt_pipelining: oszapt_pipelining: 3�apt_pipelining)�id�name�title�description�distros� frequencyZexamplesZactivate_by_schema_keys)r �cfg�cloud�args�returnc C st |j dd�}t|�j� j� }|dkr2tdtt� n>|dkr>d S |dd� td d �D �krdt|tt� ntjd|� d S ) Nr �osZfalse�0�none� unchangedc S s g | ]}t |��qS � )�str)�.0�br r �'/usr/lib/python3.6/cc_apt_pipelining.py� <listcomp>F s zhandle.<locals>.<listcomp>r � z%Invalid option for apt_pipelining: %s)r r r ) �getr �lower�strip�write_apt_snippet�LOG�DEFAULT_FILE�rangeZwarning)r r r r Zapt_pipe_valueZapt_pipe_value_sr r r �handle>