Current Path : /usr/lib/python2.7/dist-packages/landscape/manager/ |
Current File : //usr/lib/python2.7/dist-packages/landscape/manager/aptsources.pyc |
Tc @ s d d l Z d d l Z d d l Z d d l Z d d l 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 e f d YZ d e f d YZ d S( iN( t succeed( t spawn_process( t ManagerPlugin( t find_reporter_commandt ProcessErrorc B s e Z d Z RS( s. Exception raised when running a process fails.( t __name__t __module__t __doc__( ( ( s@ /usr/lib/python2.7/dist-packages/landscape/manager/aptsources.pyR s t AptSourcesc B sh e Z d Z d Z d Z d Z d d d Z d Z d Z d Z d Z d Z d Z RS( s' A plugin managing sources.list content.s /etc/apt/sources.lists /etc/apt/sources.list.dc C s- t t | j | | j d | j d S( Ns apt-sources-replace( t superR t registert register_messaget _handle_repositories( t selft registry( ( s@ /usr/lib/python2.7/dist-packages/landscape/manager/aptsources.pyR s c C s t | | d | d | S( sW Run the process in an asynchronous fashion, to be overriden in tests. t uidt gid( R ( R t commandt argsR R ( ( s@ /usr/lib/python2.7/dist-packages/landscape/manager/aptsources.pyt _run_process s c C s2 | \ } } } | r. t d | | f n d S( sQ Turn a failed process command (code != 0) to a C{ProcessError}. s %s %sN( R ( R t resultt outt errt code( ( s@ /usr/lib/python2.7/dist-packages/landscape/manager/aptsources.pyt _handle_process_error% s c C sB | j t s: | j \ } } } t d | | f n | Sd S( sG Turn a signaled process command to a C{ProcessError}. s %s %sN( t checkR t value( R t failureR R t signal( ( s@ /usr/lib/python2.7/dist-packages/landscape/manager/aptsources.pyt _handle_process_failure- s c C s t j | | S( sd Remove the temporary file created for the process, and forward the result. ( t ost unlink( R t passthrought path( ( s@ /usr/lib/python2.7/dist-packages/landscape/manager/aptsources.pyt _remove_and_continue7 s c s t d x | d D] } t j \ } } t j | t | d } | j | | j j | f d j j j j | q W j j j j | d j | f d S( sE Handle a list of repositories to set on the machine. The format is the following: {"sources": [ {"name": "repository-name", "content": "deb http://archive.ubuntu.com/ubuntu/ maverick main "deb-src http://archive.ubuntu.com/ubuntu/ maverick main"} {"name": "repository-name-dev", "content": "deb http://archive.ubuntu.com/ubuntu/ maverick universe "deb-src http://archive.ubuntu.com/ubuntu/ maverick universe"}], "gpg-keys": ["-----BEGIN PGP PUBLIC KEY BLOCK----- XXXX -----END PGP PUBLIC KEY BLOCK-----", "-----BEGIN PGP PUBLIC KEY BLOCK----- YYY -----END PGP PUBLIC KEY BLOCK-----"]} s gpg-keyst wc s j d d | g S( Ns /usr/bin/apt-keyt add( R ( t ignoreR! ( R ( s@ /usr/lib/python2.7/dist-packages/landscape/manager/aptsources.pyt <lambda>] s t sourcesc s S( N( ( ( t deferred( s@ /usr/lib/python2.7/dist-packages/landscape/manager/aptsources.pyR&