%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /opt/alt/python37/lib/python3.7/site-packages/clconfigure/__pycache__/
Upload File :
Create Path :
Current File : //opt/alt/python37/lib/python3.7/site-packages/clconfigure/__pycache__/services.cpython-37.pyc

B

�2Lb8�@sZddlmZddlZddlmZmZdZdZdZdZ	dZ
d	Zddd�Zed
�dd��Z
dS)�)�absolute_importN)�task�runZmaskedZstoppedZunmaskedZrunningZinactiveZactive�	is-activecCs td||dg�}|j��}|S)zZ
    Get information about systemctl service state
    (either activity or enability)
    �	systemctlz.service)r�stdout�strip)Zservice�kind�result�state�r�E/opt/alt/python37/lib/python3.7/site-packages/clconfigure/services.py�_get_service_states
rz<Changing service '{service_name}' state to '{desired_state}'cCs�t|dd�}t|�}t�d|||�d}|tkr>|tkr>d}n@|tkrT|tkrTd}n*|tkrj|tkrjd}n|tkr~|tkr~d}|dkr�t�d	|�n2t	d
||dg�t|�}t|�}t�d|||�dS)
zi
    Brings service to given state. May be executed more that once,
    does't crash on future calls
    z
is-enabled)r	zDChecking service '%s' state... package is in state='%s' running='%s'N�maskZunmask�stop�startz"No actions needed for service '%s'rz.servicezNChecking service '%s' state again... service now is in state='%s' running='%s')
r�logging�debug�STATE_MASKED�STATE_UNMASKED�
STATE_STOPPED�STATUS_STOPPED�
STATE_RUNNING�STATUS_RUNNINGr)Z
desired_stateZservice_nameZ
current_stateZcurrent_status�actionrrr
�set_service_states(
r)r)Z
__future__rrZclconfigurerrrrrrrrrrrrrr
�<module>s


Zerion Mini Shell 1.0