o
    (Wa                     @   s$   d dl Z d dlmZ dZdd ZdS )    N)ConfigParserz/etc/pip.confc                 C   s   t  }||  tjtr2t  }ttd}|| W d   n1 s&w   Y  || |}ttd}|	| W d   dS 1 sHw   Y  dS )z
    Update pip.conf file on /etc/ with the required configurations
    for enabling a service.

    :param pip_config_dict:
        A dictionaty representing a valid pip config
    rNw)
r   Z	read_dictospathexistsPIP_CONFIG_FILEopenZ	read_fileupdatewrite)Zpip_config_dictZnew_conf_parserZexisting_conf_parserf r   ./usr/lib/python3/dist-packages/uaclient/pip.pyupdate_pip_conf   s   

"r   )r   configparserr   r   r   r   r   r   r   <module>   s    