def is_enabled_and_bind_by_default():
 global _IS_IPV6_ENABLED
 if (_IS_IPV6_ENABLED is None):
  disabled_ipv6_path = '/proc/sys/net/ipv6/conf/default/disable_ipv6'
  if os.path.exists(disabled_ipv6_path):
   with open(disabled_ipv6_path, 'r') as f:
    disabled = f.read().strip()
   _IS_IPV6_ENABLED = (disabled == '0')
  else:
   _IS_IPV6_ENABLED = False
  if (not _IS_IPV6_ENABLED):
   LOG.info(_LI('IPv6 not present or configured not to bind to new interfaces on this system. Please ensure IPv6 is enabled and /proc/sys/net/ipv6/conf/default/disable_ipv6 is set to 0 to enable IPv6.'))
 return _IS_IPV6_ENABLED

def is_enabled_and_bind_by_default ( ) : global _IS_IPV6_ENABLED if ( _IS_IPV6_ENABLED is None ) : disabled_ipv6_path = '/proc/sys/net/ipv6/conf/default/disable_ipv6' if os . path . exists ( disabled_ipv6_path ) : with open ( disabled_ipv6_path , 'r' ) as f : disabled = f . read ( ) . strip ( ) _IS_IPV6_ENABLED = ( disabled == '0' ) else : _IS_IPV6_ENABLED = False if ( not _IS_IPV6_ENABLED ) : LOG . info ( _LI ( 'IPv6 not present or configured not to bind to new interfaces on this system. Please ensure IPv6 is enabled and /proc/sys/net/ipv6/conf/default/disable_ipv6 is set to 0 to enable IPv6.' ) ) return _IS_IPV6_ENABLED
check if host has the ipv6 support and is configured to bind ipv6 address to new interfaces by default .