HEX
Server: Apache
System: Linux server2.voipitup.com.au 4.18.0-553.109.1.lve.el8.x86_64 #1 SMP Thu Mar 5 20:23:46 UTC 2026 x86_64
User: posscale (1027)
PHP: 8.2.30
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //opt/saltstack/salt/lib/python3.10/site-packages/salt/states/__pycache__/sysfs.cpython-310.pyc
o

�N�gU�@s"dZddlZdd�Zddd�ZdS)a
Configuration of the kernel using sysfs
=======================================

Control the kernel object attributes exported by sysfs

.. code-block:: yaml

  kernel/mm/transparent_hugepage/enabled
    sysfs.present:
      - value: never

.. versionadded:: 3006.0
�NcCsdtvrdSdS)zF
    This state is only available on Minions which support sysctl
    z
sysfs.attrT)Fz sysfs module could not be loaded)�__salt__�rr�E/opt/saltstack/salt/lib/python3.10/site-packages/salt/states/sysfs.py�__virtual__srcCs&|didd�}td|�}|durd|d<d|�d�|d	<n2t|t�r/d|d<|�d
�|d	<n!t|t�r;t�dd|�}||krLd|d<d|�d�|d	<nd
|d<|dd
ur�tdrdd|�d�|d	<|Std||�}|s}d|d<d|�d|��|d	<|Sd|d<||i|d<d|�d|��|d	<|S)z�
    Ensure that the named sysfs attribute is set with the defined value

    name
        The name of the sysfs attribute to edit

    value
        The sysfs value to apply

    T�)�name�result�changes�commentz
sysfs.readFrzSysFS attribute z doesn't exist.r
z is not a SysFS attribute.z(.*\[|\].*)z is already set.N�testz set to be changed.zsysfs.writezFailed to set z to r	zUpdated SysFS attribute )r�
isinstance�dict�str�re�subZ__opts__)r�valueZconfig�ret�current�updaterrr�presents6

��r)N)�__doc__rrrrrrr�<module>s