ó
½-'Nc           @   s^   d  d l  Z  d  d l m Z d  d l m Z d d d d d d	 g Z d
 e f d „  ƒ  YZ d S(   iÿÿÿÿN(   t   Configuration(   t	   ALL_USERSt   ProcessKillert   PackageManagert   UserManagert   ShutdownManagert
   Eucalyptust
   AptSourcest   ManagerConfigurationc           B   s>   e  Z d  Z d „  Z e d „  ƒ Z d „  Z e d „  ƒ Z RS(   s4   Specialized configuration for the Landscape Manager.c         C   sj   t  t |  ƒ j ƒ  } | j d d d d d d d ƒ| j d d d d d	 ƒ| j d
 d d d d ƒ| S(   sh   
        Specialize L{Configuration.make_parser}, adding many
        manager-specific options.
        s   --manager-pluginst   metavart   PLUGIN_LISTt   helpsJ   Comma-delimited list of manager plugins to use. ALL means use all plugins.t   defaultt   ALLs   --include-manager-pluginssO   Comma-delimited list of manager plugins to enable, in addition to the defaults.s   --script-userst   USERSs\   Comma-delimited list of usernames that scripts may be run as. Default is to allow all users.(   t   superR   t   make_parsert
   add_option(   t   selft   parser(    (    s<   /usr/lib/python2.7/dist-packages/landscape/manager/config.pyR      s    c         C   s|   g  } |  j  d k r t } n |  j  r= |  j  j d ƒ } n  |  j r_ | |  j j d ƒ 7} n  g  | D] } | j ƒ  ^ qf S(   NR   t   ,(   t   manager_pluginst   ALL_PLUGINSt   splitt   include_manager_pluginst   strip(   R   t   plugin_namest   x(    (    s<   /usr/lib/python2.7/dist-packages/landscape/manager/config.pyt   plugin_factories"   s    
		c         C   sR   |  j  s d g S|  j  j ƒ  d k r) t Sg  |  j  j d ƒ D] } | j ƒ  ^ q< S(   s:  
        Based on the C{script_users} configuration value, return the users that
        should be allowed to run scripts.

        If the value is "ALL", then
        L{landscape.manager.scriptexecution.ALL_USERS} will be returned.  If
        there is no specified value, then C{nobody} will be allowed.
        t   nobodyR   R   (   t   script_usersR   R   R   (   R   R   (    (    s<   /usr/lib/python2.7/dist-packages/landscape/manager/config.pyt   get_allowed_script_users-   s
    		c         C   s   t  j j |  j d ƒ S(   Ns   manager.database(   t   ost   patht   joint	   data_path(   R   (    (    s<   /usr/lib/python2.7/dist-packages/landscape/manager/config.pyt   store_filename<   s    (   t   __name__t
   __module__t   __doc__R   t   propertyR   R   R$   (    (    (    s<   /usr/lib/python2.7/dist-packages/landscape/manager/config.pyR      s
   		(   R    t   landscape.deploymentR    t!   landscape.manager.scriptexecutionR   R   R   (    (    (    s<   /usr/lib/python2.7/dist-packages/landscape/manager/config.pyt   <module>   s
   	