D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
usr
/
libexec
/
kcare
/
python
/
kcarectl
/
Filename :
ipv6_support.pyc
back
Copy
� ��whc @ s� d d l m Z d d l m Z d d l m Z d d l m Z d d l m Z e ri d d l m Z n d e f d � � YZ e � Z d � Z d � Z d S( i ( t config( t http_utils( t log_utils( t utils( t serveridi����( t Optionalt IPProtoSelectorc B s8 e Z d � Z d � Z e d � � Z e d � � Z RS( c C s d | _ d S( N( t Nonet _cached_result( t self( ( s2 /usr/libexec/kcare/python/kcarectl/ipv6_support.pyt __init__ s c C sB t j r t j d � t St j j d � s= t j d � t St j rW t j d � t S| j d k rm | j S| j t j � s� t j d � t } n� | j t j � s� t j d � t } nx t j � r� t j d � t } nV | j d t � rt j d � t } n. | j d t � r/t j d � t } n t } | | _ | S( sk Choose ipv6 if it is more suitable. Checks order: - check config values (it is faster) - eportal setup and FORCE_IPVx - then check each proto availability using HEAD requests - then check if we have server_id, it means we don't expect an ip license - and finally we need to check if there is an ip license s, decided to use ipv4 because of config valuess kernelcare.coms, decided to use ipv6 because of config valuess1 decided to use ipv4 because ipv6 is not availables1 decided to use ipv6 because ipv4 is not availables/ decided to use ipv4 because server id was foundt ipv6s2 decided to use ipv4 because ipv4 license was founds2 decided to use ipv6 because ipv6 license was foundN( R t FORCE_IPV4R t logdebugt Falset PATCH_SERVERt endswitht FORCE_IPV6t TrueR R t _is_url_reachablet PATCH_SERVER_IPV6R t get_serveridt _has_ip_license( R t result( ( s2 /usr/libexec/kcare/python/kcarectl/ipv6_support.pyt is_ipv6_preferred s: c C s| t j | d d d d �} y'