관리-도구
편집 파일: _distro.cpython-39.pyc
a �)g� � @ s� d Z ddlZddlZddlZddlZddlZddlZddlZdZej�dd�Zej�dd�ZdZd d d�Zd d dddd �ZddiZe�d�Z e�d�Z!dddedddfZ"dd� Z#z ej$Z%W n e&y� e#Z%Y n0 dIdd�Z'dd� Z(dJdd �Z)dKd!d"�Z*dLd#d$�Z+dMd%d&�Z,dNd'd(�Z-dOd)d*�Z.d+d,� Z/d-d.� Z0dPd/d0�Z1d1d2� Z2d3d4� Z3d5d6� Z4d7d8� Z5d9d:� Z6d;d<� Z7d=d>� Z8d?d@� Z9zddAl:m;Z; W n$ e<�y� G dBdC� dCe=�Z;Y n0 G dDdE� dEe=�Z>e>� Z?dFdG� Z@eAdHk�r�e@� dS )Qa� The ``distro`` package (``distro`` stands for Linux Distribution) provides information about the Linux distribution it runs on, such as a reliable machine-readable distro ID, or version information. It is the recommended replacement for Python's original :py:func:`platform.linux_distribution` function, but it provides much more functionality. An alternative implementation became necessary because Python 3.5 deprecated this function, and Python 3.8 removed it altogether. Its predecessor function :py:func:`platform.dist` was already deprecated since Python 2.6 and removed in Python 3.8. Still, there are many cases in which access to OS distribution information is needed. See `Python issue 1322 <https://bugs.python.org/issue1322>`_ for more information. � Nz1.6.0ZUNIXCONFDIRz/etcZ UNIXUSRLIBDIRz/usr/libz os-releaseZoracleZopensuse)Zolz opensuse-leapZrhel)ZenterpriseenterpriseasZenterpriseenterpriseserverZredhatenterpriseworkstationZredhatenterpriseserverZredhatenterprisecomputenodeZredhatzA(?:[^)]*\)(.*)\()? *(?:STL )?([\d.+\-a-z]*\d) *(?:esaeler *)?(.+)z(\w+)[-_](release|version)$Zdebian_versionzlsb-releasezoem-releasezsystem-releasez plesk-releaseziredmail-releasec O sh d|v rt d��tj| dtji|��}|�� \}}|�� }|rd|�d�}|du rX| d }t�||��|S )aD Run command with arguments and return its output as a byte string. If the exit code was non-zero it raises a CalledProcessError. The CalledProcessError object will have the return code in the returncode attribute and output in the output attribute. The arguments are the same as for the Popen constructor. Example: >>> check_output(["ls", "-l", "/dev/null"]) 'crw-rw-rw- 1 root root 1, 3 Oct 18 2007 /dev/null\n' The stdout argument is not allowed as it is used internally. To capture standard error in the result, use stderr=STDOUT. >>> check_output(["/bin/sh", "-c", ... "ls -l non_existent_file ; exit 0"], ... stderr=STDOUT) 'ls: non_existent_file: No such file or directory\n' This is a backport of Python-2.7's check output to Python-2.6 �stdoutz3stdout argument not allowed, it will be overridden.�argsNr )� ValueError� subprocess�Popen�PIPEZcommunicateZpoll�get�CalledProcessError)Z popenargs�kwargsZprocess�outputZ unused_errZretcode�cmd� r �G/usr/lib/python3.9/site-packages/ansible/module_utils/distro/_distro.py�_my_check_output� s&