HEX
Server: LiteSpeed
System: Linux s787.bom1.mysecurecloudhost.com 4.18.0-477.13.1.lve.el8.x86_64 #1 SMP Thu Jun 1 16:40:47 EDT 2023 x86_64
User: mobilech (5348)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: //opt/saltstack/salt/lib/python3.10/site-packages/salt/__pycache__/exceptions.cpython-310.pyc
o

;j�=�@s�dZddlZddlZddlZddlZe�e�Zdd�Z	dd�Z
Gdd�de�ZGd	d
�d
e�Z
Gdd�de�ZGd
d�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�dee�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd �d e�ZGd!d"�d"e�ZGd#d$�d$e�ZGd%d&�d&e�ZGd'd(�d(e�ZGd)d*�d*e�ZGd+d,�d,ee �Z!Gd-d.�d.e�Z"Gd/d0�d0e�Z#Gd1d2�d2e�Z$Gd3d4�d4e�Z%Gd5d6�d6e�Z&Gd7d8�d8e�Z'Gd9d:�d:e�Z(Gd;d<�d<e�Z)Gd=d>�d>e�Z*Gd?d@�d@e�Z+GdAdB�dBe�Z,GdCdD�dDe�Z-GdEdF�dFe�Z.GdGdH�dHe�Z/GdIdJ�dJe�Z0GdKdL�dLe�Z1GdMdN�dNe�Z2GdOdP�dPe�Z3GdQdR�dRe�Z4GdSdT�dTe4�Z5GdUdV�dVe4�Z6GdWdX�dXe4�Z7GdYdZ�dZe4�Z8Gd[d\�d\e4�Z9Gd]d^�d^e4�Z:Gd_d`�d`e�Z;Gdadb�dbe�Z<Gdcdd�dde�Z=Gdedf�dfe�Z>Gdgdh�dhe�Z?Gdidj�dje�Z@Gdkdl�dle�ZAGdmdn�dneA�ZBGdodp�dpeA�ZCGdqdr�dreA�ZDGdsdt�dteA�ZEGdudv�dveA�ZFGdwdx�dxeD�ZGGdydz�dzeA�ZHGd{d|�d|eA�ZIGd}d~�d~eI�ZJGdd��d�eA�ZKGd�d��d�eA�ZLGd�d��d�eA�ZMGd�d��d�eA�ZNGd�d��d�e�ZOGd�d��d�eP�ZQGd�d��d�e�ZRGd�d��d�eR�ZSGd�d��d�eR�ZTGd�d��d�eR�ZUGd�d��d�e�ZVdS)�z;
This module is a central location for all salt exceptions
�NcCs$ddlm}i|_|�|���}|S)z-
    Serialize obj and format for output
    r)�nested)Zsalt.outputrZ__opts__�output�rstrip)�objr�ret�r�C/opt/saltstack/salt/lib/python3.10/site-packages/salt/exceptions.py�_nested_outputsr	cCs|jr|jdSdS)z:
    Get human readable message from Python Exception
    r�)�args)�errorrrr�get_error_messagesr
cs*eZdZdZd�fdd�	Zdd�Z�ZS)�
SaltExceptionzQ
    Base exception class; all Salt-specific exceptions should subclass this
    r
cs@ddl}t|t�s
t|�}t��|jj�|��||_|_	dS)Nr)
�salt.utils.stringutils�
isinstance�str�super�__init__�utils�stringutilsZto_str�message�strerror)�selfr�salt��	__class__rrr&s

zSaltException.__init__cCst|�|jd�S)zs
        Pack this exception into a serializable dictionary that is safe for
        transport via msgpack
        )rr)rr)rrrr�pack/szSaltException.pack)r
)�__name__�
__module__�__qualname__�__doc__rr�
__classcell__rrrrr!s	rc@�eZdZdZdS)�SaltClientError�-
    Problem reading the master root key
    N�rrrr rrrrr#7�r#c@r")�SaltMasterErrorr$Nr%rrrrr'=r&r'c@r")�SaltNoMinionsFoundz9
    An attempt to retrieve a list of minions failed
    Nr%rrrrr(Cr&r(c@r")�SaltSyndicMasterErrorzD
    Problem while proxying a request in the syndication master
    Nr%rrrrr)Ir&r)c@r")�SaltMasterUnresolvableErrorz7
    Problem resolving the name of the Salt master
    Nr%rrrrr*Or&r*c@r")�
MasterExitz$
    Rise when the master exits
    Nr%rrrrr+Ur&r+c@r")�AuthenticationErrorz5
    If sha256 signature fails during decryption
    Nr%rrrrr,[r&r,c@r")�InvalidKeyErrora	
    Raised when we encounter an invalid RSA key.

    Also subclasses ``ValueError`` because an invalid key IS a value error;
    callers that catch ``ValueError`` (such as the FIPS-mode key-loading
    paths in :mod:`salt.crypt`) will see this exception too.
    Nr%rrrrr-ar&r-c@r")�CommandNotFoundErrorzK
    Used in modules or grains when a required binary is not available
    Nr%rrrrr.kr&r.cs"eZdZdZd�fdd�	Z�ZS)�CommandExecutionError��
    Used when a module runs a command which returns an error and wants
    to show the user the output gracefully instead of dying
    r
Ncsddl}z	|jj�|�}Wn"ty/zt|�}Wnty,|jj�t|��}YnwYnw||_||_|jry|rI|ddvrE|d7}|d7}|d7}|t	|j�}t
|jt�rut�
|j�}|�dd�|rp|t	|�|_n|j|_n
||_n|j|_}t��|�dS)Nr���z.?!�.� zAdditional info follows:

Zchanges)rrr�
to_unicode�	TypeErrorr�UnicodeDecodeErrorr�infor	r�dict�copy�deepcopy�popZstrerror_without_changesrr)rrr7rZexc_str_prefix�exc_strZinfo_without_changesrrrrws>���

�
zCommandExecutionError.__init__)r
N�rrrr rr!rrrrr/qsr/c@r")�LoaderErrorz-
    Problems loading the right renderer
    Nr%rrrrr>�r&r>c@r")�PublishErrorz?
    Problems encountered when trying to publish a command
    Nr%rrrrr?�r&r?c@r")�MinionErrorzA
    Minion problems reading uris such as salt:// or http://
    Nr%rrrrr@�r&r@c@r")�FileserverConfigErrorz<
    Used when invalid fileserver settings are detected
    Nr%rrrrrA�r&rAc�$eZdZdZ	d�fdd�	Z�ZS)�
FileLockErrorz9
    Used when an error occurs obtaining a file lock
    NcsDt�j|g|�Ri|��|durt�d�t��|_dS||_dS)Nz�time_start should be provided when raising a FileLockError. Defaulting to current time as a fallback, but this may result in an inaccurate timeout.)rr�log�warning�time�
time_start)rrrGr�kwargsrrrr�s�
zFileLockError.__init__�Nr=rrrrrC�s�rCcs eZdZdZ�fdd�Z�ZS)�GitLockErrorax
    Raised when an uncaught error occurs in the midst of obtaining an
    update/checkout lock in salt.utils.gitfs.

    NOTE: While this uses the errno param similar to an OSError, this exception
    class is *not* as subclass of OSError. This is done intentionally, so that
    this exception class can be caught in a try/except without being caught as
    an OSError.
    cs$t�j|g|�Ri|��||_dSrI)rr�errno)rrKrrrHrrrr�s
zGitLockError.__init__r=rrrrrJ�s
rJc@r")�GitRemoteErrorzv
    Used by GitFS to denote a problem with the existence of the "origin" remote
    or part of its configuration
    Nr%rrrrrL�r&rLc@r")�SaltInvocationErrorz�
    Used when the wrong number of arguments are sent to modules or invalid
    arguments are specified on the command line
    Nr%rrrrrM�r&rMc@r")�
PkgParseErrorz�
    Used when of the pkg modules cannot correctly parse the output from
    the CLI tool (pacman, yum, apt, aptitude, etc)
    Nr%rrrrrN�r&rNcs*eZdZdZ				d�fdd�	Z�ZS)�SaltRenderErrorz�
    Used when a renderer needs to raise an explicit error. If a line number and
    buffer string are passed, get_context will be invoked to get the location
    of the error.
    Nr
�    <======================cs�ddl}||_z	|jj�|�}Wn"ty2zt|�}Wnty/|jj�t|��}YnwYnw||_||_	d|_
|rF|d|�d�7}|jrl|j	rlddl}|jjj|j	|j|d�|_
|d�
|j|jj�|j
��7}t��|�dS)Nrr
�
)�markerz
; line {}

{})rrrrr4r5rr6�line_num�buffer�contextZsalt.utils.templatesZget_context�formatrr)rrrS�bufrRZtracerr<rrrrs6	���

��zSaltRenderError.__init__)Nr
rPNr=rrrrrOs	�rOcrB)�SaltClientTimeoutzu
    Thrown when a job sent through one of the Client interfaces times out

    Takes the ``jid`` as a parameter
    Ncs$t�j|g|�Ri|��||_dSrI)rr�jid)rrrYrrHrrrr9s
zSaltClientTimeout.__init__rIr=rrrrrX2s�rXc@r")�SaltCacheErrorz[
    Thrown when a problem was encountered trying to read or write from the salt cache
    Nr%rrrrrZ@r&rZc@r")�TimeoutErrorzP
    Thrown when an opration cannot be completet within a given time limit.
    Nr%rrrrr[Fr&r[c@r")�SaltReqTimeoutErrorzS
    Thrown when a salt master request call fails to return within the timeout
    Nr%rrrrr\Lr&r\c@r")�TimedProcTimeoutErrorz�
    Thrown when a timed subprocess does not terminate within the timeout,
    or if the specified timeout is not an int or a float
    Nr%rrrrr]Rr&r]c@r")�EauthAuthenticationErrorz0
    Thrown when eauth authentication fails
    Nr%rrrrr^Yr&r^c@r")�TokenAuthenticationErrorz0
    Thrown when token authentication fails
    Nr%rrrrr__r&r_c@r")�SaltDeserializationErrorz3
    Thrown when salt cannot deserialize data.
    Nr%rrrrr`er&r`c@r")�AuthorizationErrorzH
    Thrown when runner or wheel execution fails due to permissions
    Nr%rrrrrakr&rac@r")�SaltValidationErrorz.
    Thrown when a value fails validation
    Nr%rrrrrbqr&rbc@r")�UnsupportedAlgorithmzR
    Thrown when a requested encryption or signing algorithm is un-supported.
    Nr%rrrrrcwr&rcc@r")�SaltDaemonNotRunningz�
    Throw when a running master/minion/syndic is not running but is needed to
    perform the requested operation (e.g., eauth).
    Nr%rrrrrd}r&rdc@r")�SaltRunnerErrorz
    Problem in runner
    Nr%rrrrre�r&rec@r")�SaltWheelErrorz
    Problem in wheel
    Nr%rrrrrf�r&rfc@r")�SaltConfigurationErrorz
    Configuration error
    Nr%rrrrrg�r&rgc@seZdZdZddd�ZdS)�SaltSystemExitz~
    This exception is raised when an unsolvable problem is found. There's
    nothing else to do, salt should just exit.
    rNcCst�||�dSrI)�
SystemExitr)r�code�msgrrrr�szSaltSystemExit.__init__)rN)rrrr rrrrrrh�srhc@r")�SaltCloudExceptionz&
    Generic Salt Cloud Exception
    Nr%rrrrrl�r&rlcs*eZdZdZejjjf�fdd�	Z�Z	S)�SaltCloudSystemExitzH
    This exception is raised when the execution should be stopped.
    cst��|�||_||_dSrI)rrr�	exit_code)rrrnrrrr�s
zSaltCloudSystemExit.__init__)
rrrr r�defaultsZ	exitcodesZ
EX_GENERICrr!rrrrrm�srmc@r")�SaltCloudConfigErrorzL
    Raised when a configuration setting is not found and should exist.
    Nr%rrrrrp�r&rpc@r")�SaltCloudNotFoundzU
    Raised when some cloud provider function cannot find what's being searched.
    Nr%rrrrrq�r&rqc@r")�SaltCloudExecutionTimeoutzO
    Raised when too much time has passed while querying/waiting for data.
    Nr%rrrrrr�r&rrc@r")�SaltCloudExecutionFailurezV
    Raised when too much failures have occurred while querying/waiting for data.
    Nr%rrrrrs�r&rsc@r")�SaltCloudPasswordErrorz;
    Raise when virtual terminal password input failed
    Nr%rrrrrt�r&rtc@r")�NotImplementedr0Nr%rrrrru�r&ruc@r")�
TemplateErrorz=
    Used when a custom error is triggered in a template
    Nr%rrrrrv�r&rvc@r")�ArgumentValueErrorzI
    Used when an invalid argument was passed to a command execution
    Nr%rrrrrw�r&rwc@r")�
CheckErrorz!
    Used when a check fails
    Nr%rrrrrx�r&rxc@r")�InvalidConfigErrorz)
    Used when the config is invalid
    Nr%rrrrry�r&ryc@r")�InvalidEntityErrorz.
    Used when an entity fails validation
    Nr%rrrrrz�r&rzc@r")�VMwareSaltError�7
    Used when a VMware object cannot be retrieved
    Nr%rrrrr{�r&r{c@r")�VMwareRuntimeErrorzZ
    Used when a runtime error is encountered when communicating with the
    vCenter
    Nr%rrrrr}�r&r}c@r")�VMwareConnectionErrorzi
    Used when the client fails to connect to a either a VMware vCenter server or
    to a ESXi host
    Nr%rrrrr~r&r~c@r")�VMwareObjectRetrievalErrorr|Nr%rrrrr
r&rc@r")�VMwareObjectNotFoundError�1
    Used when a VMware object was not found
    Nr%rrrrr�r&r�c@r")�VMwareObjectExistsErrorz2
    Used when a VMware object already exists
    Nr%rrrrr�r&r�c@r")�VMwareMultipleObjectsErrorzJ
    Used when multiple objects were retrieved (and one was expected)
    Nr%rrrrr�r&r�c@r")�VMwareNotFoundErrorr�Nr%rrrrr�"r&r�c@r")�VMwareApiErrorz;
    Used when representing a generic VMware API error
    Nr%rrrrr�(r&r�c@r")�VMwareFileNotFoundErrorzK
    Used when representing a generic VMware error if a file not found
    Nr%rrrrr�.r&r�c@r")�VMwareSystemErrorz>
    Used when representing a generic VMware system error
    Nr%rrrrr�4r&r�c@r")�VMwarePowerOnErrorz2
    Used when error occurred during power on
    Nr%rrrrr�:r&r�c@r")�VMwareVmRegisterError�:
    Used when a configuration parameter is incorrect
    Nr%rrrrr�@r&r�c@r")�VMwareVmCreationErrorr�Nr%rrrrr�Fr&r�c@r")�
MissingSmbz.
    Raised when no smb library is found.
    Nr%rrrrr�Lr&r�c@r")�LoggingRuntimeErrorz9
    Raised when we encounter an error while logging
    Nr%rrrrr�Rr&r�c@r")�	NxosErrorz$
    NX-OS Base Exception class
    Nr%rrrrr�Xr&r�c@r")�NxosCliErrorzN
    NX-OS Cli Error raised when Cli command rejected by the NX-OS device
    Nr%rrrrr�^r&r�c@r")�NxosClientErrorzO
    NX-OS Client Error raised for problems connecting to the NX-OS device
    Nr%rrrrr�dr&r�c@r")�NxosRequestNotSupportedz0
    Raised for unsupported client requests
    Nr%rrrrr�jr&r�c@r")�
CodePageErrorzS
    Raised when an error ocurs while getting or setting the windows code page
    Nr%rrrrr�pr&r�)Wr r9�loggingrFZsalt.defaults.exitcodesr�	getLoggerrrDr	r
�	Exceptionrr#r'r(r)r*rir+r,�
ValueErrorr-r.r/r>r?r@rArCrJrLr5rMrNrOrXrZr[r\r]r^r_r`rarbrcrdrerfrgrhrlrmrprqrrrsrtrurvrwrxryrzr{r}r~rr�r�r�r�r�r�r�r�r�r�r��RuntimeErrorr�r�r�r�r�r�rrrr�<module>s�

>2