def find_sock_file(conf_file):
 try:
  fd = open(conf_file)
 except IOError as e:
  utils.err(('Error: %s. Config file path is relative: %s' % (e, conf_file)))
  return None
 try:
  for line in fd:
   if line.lstrip('  DCTB ').startswith('stats socket'):
    sock_file = line.split()[2]
    if utils.is_sockfile(sock_file):
     return sock_file
 finally:
  fd.close()

def find_sock_file ( conf_file ) : try : fd = open ( conf_file ) except IOError as e : utils . err ( ( 'Error: %s. Config file path is relative: %s' % ( e , conf_file ) ) ) return None try : for line in fd : if line . lstrip ( '  DCTB ' ) . startswith ( 'stats socket' ) : sock_file = line . split ( ) [ 2 ] if utils . is_sockfile ( sock_file ) : return sock_file finally : fd . close ( )
returns the unix socket file of haproxy .