a ì)gNã@s:ddlmZmZmZeZddlZddlmZddd„Z dS)é)Úabsolute_importÚdivisionÚprint_functionN)Ú is_executablec Csô|dur gn|}gd¢}g}|D]"}|dur tj |¡r | |¡q |tj dd¡ tj¡7}d}|D]"}||vrftj |¡rf| |¡qf|D]@}|s˜qŽtj ||¡}tj |¡rŽtj  |¡sŽt |ƒrŽ|}qÐqŽ|durðt d|tj |¡fƒ‚|S)aœ Find system executable in PATH. Raises ValueError if executable is not found. Optional arguments: - required: [Deprecated] Prior to 2.10, if executable is not found and required is true it raises an Exception. In 2.10 and later, an Exception is always raised. This parameter will be removed in 2.14. - opt_dirs: optional list of directories to search in addition to PATH In addition to PATH and opt_dirs, this function also looks through /sbin, /usr/sbin and /usr/local/sbin. A lot of modules, especially for gathering facts, depend on this behaviour. If found return full path, otherwise raise ValueError. N)z/sbinz /usr/sbinz/usr/local/sbinÚPATHÚz4Failed to find required executable "%s" in paths: %s) ÚosÚpathÚexistsÚappendÚenvironÚgetÚsplitÚpathsepÚjoinÚisdirrÚ ValueError) ÚargZopt_dirsÚrequiredZ sbin_pathsÚpathsÚdZbin_pathÚpr ©rúG/usr/lib/python3.9/site-packages/ansible/module_utils/common/process.pyÚ get_bin_path s*    r)NN) Z __future__rrrÚtypeZ __metaclass__rZ ansible.module_utils.common.filerrrrrrÚs