%PDF- %PDF-
Mini Shell

Mini Shell

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

�
���^c@@s�dZddlmZmZmZddlZddlZddlj	j
Z
ddlmZdZ
d�Ze
jd��Zd�Zd	�Zd
d�ZdS(u
Support for GRUB Legacy
i(tabsolute_importtprint_functiontunicode_literalsN(tCommandExecutionErrorugrubcC@s#tjjt��rtStdfS(u3
    Only load the module if grub is installed
    ueThe grub_legacy execution module cannot be loaded: the grub config file does not exist in /boot/grub/(tostpathtexistst_detect_conft__virtualname__tFalse(((s</usr/lib/python2.7/site-packages/salt/modules/grub_legacy.pyt__virtual__scC@stddkrdSdS(u8
    GRUB conf location differs depending on distro
    u	os_familyuRedHatu/boot/grub/grub.confu/boot/grub/menu.lst(t
__grains__(((s</usr/lib/python2.7/site-packages/salt/modules/grub_legacy.pyRscC@sd}td|�}|S(u~
    Return server version from grub --version

    CLI Example:

    .. code-block:: bash

        salt '*' grub.version
    u/sbin/grub --versionucmd.run(t__salt__(tcmdtout((s</usr/lib/python2.7/site-packages/salt/modules/grub_legacy.pytversion(s
cC@sid}g}t}i}d}y�tjjjt�d���}x!|D]}tjjj|�}|jd�rvqFn|jd�r�t}d|kr�|dj	|�7}|d7}|j
|�nd}qFn|j�jd�r'|r|dj	|�7}|d7}|j
|�d}q't}n|r:||7}n|sFt
|�\}}|||<qFqFW|r�|jd�s�|d7}n||7}|dj	|�7}|d7}|j
|�nWd	QXWn4ttfk
r�}	d
}
t|
j	|	���nXg|d<x^|D]V}i}x6|j�j�D]"}t
|�\}}|||<q*W|dj
|�qW|S(uf
    Parse GRUB conf file

    CLI Example:

    .. code-block:: bash

        salt '*' grub.conf
    uiuru#u
utitleu	order {0}iNuCould not read grub config: {0}ustanzas(R	tsalttutilstfilestfopenRtstringutilst
to_unicodet
startswithtformattappendtstriptTruet_parse_linetendswithtIOErrortOSErrorRt
splitlines(tstanzatstanzast	in_stanzatrettpost_fptlinetkeytvaluetexctmsgtmydict((s</usr/lib/python2.7/site-packages/salt/modules/grub_legacy.pytconf7sb




		





ucC@s4|j�}|jd�}dj|�}||fS(uH
    Used by conf() to break config lines into
    name/value pairs
    iu (tsplittpoptjoin(R&tpartsR'R(((s</usr/lib/python2.7/site-packages/salt/modules/grub_legacy.pyRvs(t__doc__t
__future__RRRRtsalt.utils.filesRtsalt.utils.decoratorsRt
decoratorstsalt.exceptionsRRR
tmemoizeRRR,R(((s</usr/lib/python2.7/site-packages/salt/modules/grub_legacy.pyt<module>s	
		?

Zerion Mini Shell 1.0