%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /proc/self/root/lib/python2.7/site-packages/salt/utils/decorators/
Upload File :
Create Path :
Current File : //proc/self/root/lib/python2.7/site-packages/salt/utils/decorators/state.pyo

�
���^c@@smdZddlmZmZddlZddlZddlmZej	e
�Zdefd��YZ
dS(uK
Decorators for salt.state

:codeauthor: :email:`Bo Maryniuk (bo@suse.de)`
i(tabsolute_importtunicode_literalsN(t
SaltExceptiont
OutputUnifiercB@s,eZd�Zd�Zd�Zd�ZRS(cG@s^g|_xN|D]F}t||�s=tdj|���q|jjt||��qWdS(NuUnknown policy: {0}(tpoliciesthasattrRtformattappendtgetattr(tselfRtpls((s?/usr/lib/python2.7/site-packages/salt/utils/decorators/state.pyt__init__s
	
c@s��fd�}|S(Nc@s��||�}x{�jD]p}y||�}Wqtk
r�}tjd|dtj�itd6dd6id6dj|�d6}qXqW|S(	Nu'An exception occurred in this state: %stexc_info_on_logleveluresultulaterunameuchangesu(An exception occurred in this state: {0}ucomment(Rt	ExceptiontlogtdebugtloggingtDEBUGtFalseR(targstkwargstresultR
texc(tfuncR	(s?/usr/lib/python2.7/site-packages/salt/utils/decorators/state.pyt_funcs
((R	RR((RR	s?/usr/lib/python2.7/site-packages/salt/utils/decorators/state.pyt__call__scC@s�t|t�sd}n�t|jd�t�s9d}nfg}x6ddddgD]"}||krR|j|�qRqRW|r�djdj|��}nd	}|r�t|��n|S(
u�
        Checks for specific types in the state output.
        Raises an Exception in case particular rule is broken.

        :param result:
        :return:
        u7Malformed state return. Data must be a dictionary type.uchangesu!'Changes' should be a dictionary.unameuresultucommentu=The following keys were not present in the state return: {0}.u, N(t
isinstancetdicttgetRRtjointNoneR(R	Rterr_msgtmissingtval((s?/usr/lib/python2.7/site-packages/salt/utils/decorators/state.pyt
content_check.s		cC@s�t|jd�t�rTdjg|dD]}tjjj|�^q)�|d<n|jd�dk	r�t	|d�|d<n|S(u�
        While comments as a list are allowed,
        comments needs to be strings for backward compatibility.
        See such claim here: https://github.com/saltstack/salt/pull/43070

        Rules applied:
          - 'comment' is joined into a multi-line string, in case the value is a list.
          - 'result' should be always either True, False or None.

        :param result:
        :return:
        ucommentu
uresultN(
RRtlistRtsalttutilststringutilst
to_unicodeRtbool(R	Rtelm((s?/usr/lib/python2.7/site-packages/salt/utils/decorators/state.pytunifyIs
6(t__name__t
__module__RRR"R*(((s?/usr/lib/python2.7/site-packages/salt/utils/decorators/state.pyRs			(t__doc__t
__future__RRRtsalt.utils.stringutilsR$tsalt.exceptionsRt	getLoggerR+RtobjectR(((s?/usr/lib/python2.7/site-packages/salt/utils/decorators/state.pyt<module>s

Zerion Mini Shell 1.0