File: //var/opt/nydus/ops/primordial/__pycache__/constants.cpython-39.pyc
a
�,�h � @ s` d Z zddlZW n ey" Y n0 ddlZddlZddlZdZdZdZe d�dd�Z
e
� ZdS ) z2This module holds constants needed for primordial.� Nz%Y-%m-%dT%H:%M:%S.%fZz%Y-%m-%dT%H:%M:%S.%fz%Y-%m-%dT%H:%M:%SZ)�returnc
C s� zRdd� t �t �� �d D �} | rP| D ]}t�t|��jr&| W S q&| d W S W n t jyf Y n0 zJt � t jt j �}t
�d�d�d�d��}t �
t�|�� d|�d d
� �W S ttt jfy� Y dS 0 dS )
z#Get the IP address of this machine.c S s g | ]}|� d �s|�qS )z127.)�
startswith)�.0�ip� r �E/opt/nydus/tmp/pip-target-wkfpz8uv/lib/python/primordial/constants.py�
<listcomp> � zgetIP.<locals>.<listcomp>� r Z256s�asciiZeth0i� � � z 127.0.0.1N)�socket�gethostbyname_ex�gethostname� ipaddress�
ip_address�str�
is_private�gaierror�AF_INET�
SOCK_DGRAM�struct�pack�encode� inet_ntoa�fcntl�ioctl�fileno�IOError�RuntimeError)�ipsr �sZipstrr r r �getIP s"