%PDF- %PDF-
Direktori : /usr/lib/python2.7/site-packages/salt/modules/ |
Current File : //usr/lib/python2.7/site-packages/salt/modules/mac_sysctl.pyc |
� ���^c @@ s� d Z d d l m Z m Z m Z d d l Z d d l Z d d l m Z d d l m Z d Z d � Z e d � Z d � Z d � Z d e d � Z d S( u4 Module for viewing and modifying sysctl parameters i ( t absolute_importt unicode_literalst print_functionN( t CommandExecutionError( t sixu sysctlc C@ s t d d k r t St d f S( u, Only run on Darwin (macOS) systems u osu MacOSuU The darwin_sysctl execution module cannot be loaded: Only available on macOS systems.( t __grains__t __virtualname__t False( ( ( s; /usr/lib/python2.7/site-packages/salt/modules/mac_sysctl.pyt __virtual__ s c C@ s d } d } i } t d | d d d t �} d g } x� | j � D]� } t g | D] } | j d j | � � ^ qT � r� | j d | k r� d n d d � } t | � d k r� | d | | d <qd | | d <qD | d rD | | d c d j | � 7<qD qD qD W| S( u� Return a list of sysctl parameters for this minion CLI Example: .. code-block:: bash salt '*' sysctl.show u auditu debugu hwu kernu machdepu netu securityu useru vfsu vmu sysctl -au cmd.runt output_loglevelu tracet python_shellu u {0}.u : u = i i i u {0} ( u auditu debugu hwu hwu kernu machdepu netu netu securityu useru vfsu vm( t __salt__R t splitlinest anyt startswitht formatt splitt len( t config_filet rootst cmdt rett outt compst linet root( ( s; /usr/lib/python2.7/site-packages/salt/modules/mac_sysctl.pyt show s4 1$ c C@ s) d j | � } t d | d t �} | S( u� Return a single sysctl parameter for this minion name The name of the sysctl value to display. CLI Example: .. code-block:: bash salt '*' sysctl.get hw.physmem u sysctl -n {0}u cmd.runR ( R R R ( t nameR R ( ( s; /usr/lib/python2.7/site-packages/salt/modules/mac_sysctl.pyt getQ s c C@ s� i } d j | | � } t d | d t �} | d d k rZ t d j | d � � � n | d j d d � \ } } | j d � d | | <| S( u Assign a single sysctl parameter for this minion name The name of the sysctl value to edit. value The sysctl value to apply. CLI Example: .. code-block:: bash salt '*' sysctl.assign net.inet.icmp.icmplim 50 u sysctl -w {0}="{1}"u cmd.run_allR u retcodei u sysctl failed: {0}u stderru stdoutu :i u -> i����( R R R R R ( R t valueR R t datat new_namet new_value( ( s; /usr/lib/python2.7/site-packages/salt/modules/mac_sysctl.pyt assignc s u /etc/sysctl.confc C@ sc g } t } t j | � } t j j | � s� y2 t j j j | d � � } | j d � Wd QXWq� t t f k r� d } t | j | � � � q� Xn t j j j | d � �} x| D]} t j j j | � } | j d j | � � s� | j | � q� q� | j d d � \ } } | j d � rD| j d d � \ } } } nM | j d � rq| j d d � \ } } } n | j � d } | t | � } | | k r�d S| j d j | | � � t } q� WWd QX| s�| j d j | | � � n g | D] } t j j j | � ^ q�} t j j j | d � � } | j | � Wd QX| t k r_t | | � d Sd S( uW Assign and persist a simple sysctl parameter for this minion name The name of the sysctl value to edit. value The sysctl value to apply. config The location of the sysctl configuration file. apply_change Default is False; Default behavior only creates or edits the sysctl.conf file. If apply is set to True, the changes are applied to the system. CLI Example: .. code-block:: bash salt '*' sysctl.persist net.inet.icmp.icmplim 50 salt '*' sysctl.persist coretemp_load NO config=/etc/sysctl.conf u w+u"