File: //opt/saltstack/salt/lib/python3.10/site-packages/salt/__pycache__/minion.cpython-310.pyc
o
;j4A � @ s( d Z ddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl
Z
ddlZddlZddl
Z
ddlZddlZddlZddlZddlZddlZddlmZ ddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZddl Zddl!Zddl"Zddl#Zddl$Zddl%Zddl&Zddl'Zddl(Zddl)Zddl*Zddl+Zddl,Zddl-Zddl.Zddl/Zddl0Zddl1Zddl2Zddl3Zddl4Zddl5Zddl6Zddl7Zddl8Zddl9Zddl:Zddl;Zddl<Zddl=m>Z> ddl?m@Z@ ddlAmBZB ddlCmDZDmEZEmFZFmGZGmHZHmIZImJZJmKZKmLZL ddlMmNZN dd lOmPZP dd
lQmRZR ddl/mSZS ddl5mTZT dd
l7mUZUmVZVmWZW ddl<mXZXmYZY zddlZZZdZ[W n e\�y` dZ[Y nw zddl]Z]dZ^W n e\�yu dZ^Y nw zddl_ZdZ`W n e\�y� dZ`Y nw e�aeb�Zce�d� Zedd� Zfd<dd�Zgd=dd�Zhdd� Zidd� Zjd>dd�Zkdd� Zld?d d!�Zmd"d#� ZnG d$d%� d%�ZoG d&d'� d'eo�ZpG d(d)� d)�ZqG d*d+� d+eo�ZrG d,d-� d-eo�ZsG d.d/� d/es�ZtG d0d1� d1eo�ZuG d2d3� d3er�Zvd4d5� Zwd6d7� ZxG d8d9� d9es�ZyG d:d;� d;ep�ZzdS )@z
Routines to set up a minion
� N)�OrderedDict)� ipaddress)�DEFAULT_MINION_OPTS)�DEFAULT_TARGET_DELIM) �CommandExecutionError�CommandNotFoundError�SaltClientError�SaltDaemonNotRunning�
SaltException�SaltInvocationError�SaltMasterUnresolvableError�SaltReqTimeoutError�SaltSystemExit)�SLS_ENCODING)�RequestContext)�enable_sigusr1_handler)�tagify)�parse_host_port)�ProcessManager�SignalHandlingProcess�default_signals)�ZMQ_VERSION_INFO�zmqTFc C s t �� dS )z�
Signal any in-progress resolve_dns() retry loop to abort on its next
wakeup. Used by the minion shutdown path so SIGTERM is not blocked by
a synchronous ``time.sleep`` inside the DNS retry loop.
N)�_RESOLVE_DNS_ABORT�set� r r �?/opt/saltstack/salt/lib/python3.10/site-packages/salt/minion.py�request_resolve_dns_abortx s r � �?c C sX | dkr|� � S t�� | } |� � rdS |t�� }|dkr#|� � S t�t||�� q)a�
Sleep up to ``duration`` seconds in ``chunk``-second slices, returning
early if ``abort_event`` becomes set. Returns True if the event was
observed set (i.e. the sleep was aborted), False otherwise.
Using small chunks rather than ``abort_event.wait(duration)`` keeps
behavior consistent across platforms where ``Event.wait`` may starve
other threads sharing the GIL during very long timeouts.
r T)�is_set�time� monotonic�sleep�min)ZdurationZabort_event�chunkZdeadline� remainingr r r �_interruptible_sleep� s
�r&