Anons79 Mini Shell

Directory : /lib/python2.7/site-packages/ansible/module_utils/common/
Upload File :
Current File : //lib/python2.7/site-packages/ansible/module_utils/common/sys_info.pyo

�
�Udac@`s|ddlmZmZmZeZddlZddlmZddl	m
Z
dZd�Zd	�Z
d
�Zd�ZdS(
i(tabsolute_importtdivisiontprint_functionN(tdistro(tget_all_subclassestget_distributiontget_distribution_versiontget_platform_subclasscC`sjd}tj�dkrftj�j�}|dkr?d}qf|dkrTd}qf|sfd}qfn|S(s�
    Return the name of the distribution the module is running on

    :rtype: NativeString or None
    :returns: Name of the distribution the module is running on

    This function attempts to determine what Linux distribution the code is running on and return
    a string representing that value.  If the distribution cannot be determined, it returns
    ``OtherLinux``.  If not run on Linux it returns None.
    tLinuxtAmzntAmazontRheltRedhatt
OtherLinuxN(tNonetplatformtsystemRtidt
capitalize(tdistribution((sH/usr/lib/python2.7/site-packages/ansible/module_utils/common/sys_info.pyRs		cC`s�d}td	�}tj�dkr�tj�}tj�}|dk	r�||kr�tjdt�}|dkr�dj|j	d�d �}n|dkr�|}q�q�q�d}n|S(
s1
    Get the version of the Linux distribution the code is running on

    :rtype: NativeString or None
    :returns: A string representation of the version of the distribution. If it cannot determine
        the version, it returns empty string. If this is not run on a Linux machine it returns None
    ucentosudebianRtbestu.iuN(ucentosudebian(
Rt	frozensetRRRtversionRtTruetjointsplit(Rtneeds_best_versiont	distro_idtversion_best((sH/usr/lib/python2.7/site-packages/ansible/module_utils/common/sys_info.pyR+s 		cC`s�d}tj�dkr�tj�}|jd�}|dkrQ|jd�}n|dkr�tj�dkr�tj�}|jd�}n|dkr�tj�}|dkr�d}q�q�n|S(s�
    Return the code name for this Linux Distribution

    :rtype: NativeString or None
    :returns: A string representation of the distribution's codename or None if not a Linux distro
    Rtversion_codenametubuntu_codenametubuntutcodenameuN(	RRRRtos_release_infotgetRtlsb_release_infoR (R R!R#((sH/usr/lib/python2.7/site-packages/ansible/module_utils/common/sys_info.pytget_distribution_codenameTscC`s�tj�}t�}d}|dk	rwxMt|�D]<}|jdk	r4|j|kr4|j|kr4|}q4q4Wn|dkr�x>t|�D]-}|j|kr�|jdkr�|}q�q�Wn|dkr�|}n|S(s�
    Finds a subclass implementing desired functionality on the platform the code is running on

    :arg cls: Class to find an appropriate subclass for
    :returns: A class that implements the functionality on this platform

    Some Ansible modules have different implementations depending on the platform they run on.  This
    function is used to select between the various implementations and choose one.  You can look at
    the implementation of the Ansible :ref:`User module<user_module>` module for an example of how to use this.

    This function replaces ``basic.load_platform_subclass()``.  When you port code, you need to
    change the callers to be explicit about instantiating the class.  For instance, code in the
    Ansible User module changed from::

    .. code-block:: python

        # Old
        class User:
            def __new__(cls, args, kwargs):
                return load_platform_subclass(User, args, kwargs)

        # New
        class User:
            def __new__(cls, args, kwargs):
                new_cls = get_platform_subclass(User)
                return super(cls, new_cls).__new__(new_cls, args, kwargs)
    N(RRRRRR(tclst
this_platformRtsubclasstsc((sH/usr/lib/python2.7/site-packages/ansible/module_utils/common/sys_info.pyRrs	-	(sget_distributionsget_distribution_versionsget_platform_subclass(t
__future__RRRttypet
__metaclass__Rtansible.module_utilsRt"ansible.module_utils.common._utilsRt__all__RRR$R(((sH/usr/lib/python2.7/site-packages/ansible/module_utils/common/sys_info.pyt<module>s		)	

Anons79 File Manager Version 1.0, Coded By Anons79
Email: [email protected]