%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python2.7/site-packages/salt/states/
Upload File :
Create Path :
Current File : //lib/python2.7/site-packages/salt/states/ethtool.pyo

�
���^c@@sudZddlmZmZmZddlZddlmZeje	�Z
d�Zd�Zd�Z
d�ZdS(	u�
Configuration of network device

.. versionadded:: 2016.11.0

:codeauthor:    Krzysztof Pawlowski <msciciel@msciciel.eu>
:maturity:      new
:depends:       python-ethtool
:platform:      linux

.. code-block:: yaml

    eth0:
      ethtool.coalesce:
        - name: eth0
        - rx_usecs: 24
        - tx_usecs: 48

    eth0:
      ethtool.ring:
        - name: eth0
        - rx: 1024
        - tx: 1024

    eth0:
      ethtool.offload:
        - name: eth0
        - tcp_segmentation_offload: on

i(tabsolute_importtprint_functiontunicode_literalsN(tsixcC@sdtkrdStS(u
    Provide ethtool state
    uethtool.show_driveruethtool(t__salt__tFalse(((s7/usr/lib/python2.7/site-packages/salt/states/ethtool.pyt__virtual__,sc
K@si|d6id6td6dj|�d6}t}d|krVtjdt�|d<ny<td|�}t|t�s�t|d<dj|�|d<|Si}g}xf|j�D]X\}}||kr�|||kr�|j	i||6�|j
d	j||��q�q�W|drX|s"|S|rXd|d<d
j|dj|��|d<|Sn|r�t}dj|�|d<dj|�|dd
<nWn1t
k
r�}	t|d<tj|	�|d<|SX|rytd||�Wqt
k
r}	t|d<tj|	�|d<|SXn|S(um
    Manage coalescing settings of network device

    name
        Interface name to apply coalescing settings

    .. code-block:: yaml

        eth0:
          ethtool.coalesce:
            - name: eth0
            - adaptive_rx: on
            - adaptive_tx: on
            - rx_usecs: 24
            - rx_frame: 0
            - rx_usecs_irq: 0
            - rx_frames_irq: 0
            - tx_usecs: 48
            - tx_frames: 0
            - tx_usecs_irq: 0
            - tx_frames_irq: 0
            - stats_block_usecs: 0
            - pkt_rate_low: 0
            - rx_usecs_low: 0
            - rx_frames_low: 0
            - tx_usecs_low: 0
            - tx_frames_low: 0
            - pkt_rate_high: 0
            - rx_usecs_high: 0
            - rx_frames_high: 0
            - tx_usecs_high: 0
            - tx_frames_high: 0
            - sample_interval: 0

    unameuchangesuresultu6Network device {0} coalescing settings are up to date.ucommentutestuethtool.show_coalesceu0Device {0} coalescing settings are not supportedu{0}: {1}u9Device {0} coalescing settings are set to be updated:
{1}u
u'Device {0} coalescing settings updated.uethtool_coalesceuethtool.set_coalesceN(tTruetformatRt__opts__tgetRt
isinstancetdicttitemstupdatetappendtNonetjointAttributeErrorRt	text_type(
tnametkwargstrettapply_coalescingtoldtnewtdifftkeytvalueterror((s7/usr/lib/python2.7/site-packages/salt/states/ethtool.pytcoalesce3sX$
 



c
K@sAi|d6id6td6dj|�d6}t}d|krVtjdt�|d<nyatd|�}t|t�s�t|d<dj|�|d<|Si}g}x�|j�D]}\}}||kr�|d	kr�|d
j|�}n|||kr/|j	i||6�|j
dj||��q/q�q�W|dr}|sG|S|r}d|d<dj|d
j|��|d<|Sn|r�t}dj|�|d<d
j|�|dd<nWn1t
k
r�}	t|d<tj|	�|d<|SX|r=ytd||�Wq=t
k
r9}	t|d<tj|	�|d<|SXn|S(u]
    Manage rx/tx ring parameters of network device

    Use 'max' word to set with factory maximum

    name
        Interface name to apply ring parameters

    .. code-block:: yaml

        eth0:
          ethtool.ring:
            - name: eth0
            - rx: 1024
            - rx_mini: 0
            - rx_jumbo: 0
            - tx: max

    unameuchangesuresultu2Network device {0} ring parameters are up to date.ucommentutestuethtool.show_ringu,Device {0} ring parameters are not supportedumaxu{0}_maxu{0}: {1}u5Device {0} ring parameters are set to be updated:
{1}u
u#Device {0} ring parameters updated.uethtool_ringuethtool.set_ringN(RRRR	R
RRRR
RRRRRRR(
RRRt
apply_ringRRRRRR((s7/usr/lib/python2.7/site-packages/salt/states/ethtool.pytring�s^
#



c
K@s.i|d6id6td6dj|�d6}t}d|krVtjdt�|d<nyNtd|�}t|t�s�t|d<dj|�|d<|Si}g}xx|j�D]j\}}|r�d	p�d
}||kr�|||kr�|j	i||6�|j
dj||��q�q�W|drj|s4|S|rjd|d<dj|d
j|��|d<|Sn|r�t}dj|�|d<d
j|�|dd<nWn1t
k
r�}	t|d<tj|	�|d<|SX|r*ytd||�Wq*t
k
r&}	t|d<tj|	�|d<|SXn|S(u

    Manage protocol offload and other features of network device

    name
        Interface name to apply coalescing settings

    .. code-block:: yaml

        eth0:
          ethtool.offload:
            - name: eth0
            - tcp_segmentation_offload: on

    unameuchangesuresultu3Network device {0} offload settings are up to date.ucommentutestuethtool.show_offloadu-Device {0} offload settings are not supporteduonuoffu{0}: {1}u6Device {0} offload settings are set to be updated:
{1}u
u$Device {0} offload settings updated.uethtool_offloaduethtool.set_offloadN(RRRR	R
RRRR
RRRRRRR(
RRRt
apply_offloadRRRRRR((s7/usr/lib/python2.7/site-packages/salt/states/ethtool.pytoffload�sZ
 



(t__doc__t
__future__RRRtloggingtsalt.extRt	getLoggert__name__tlogRRR R"(((s7/usr/lib/python2.7/site-packages/salt/states/ethtool.pyt<module>s		`	T

Zerion Mini Shell 1.0