def _read_config(conf_file=None):
 if (conf_file is None):
  paths = ('/etc/supervisor/supervisord.conf', '/etc/supervisord.conf')
  for path in paths:
   if os.path.exists(path):
    conf_file = path
    break
 if (conf_file is None):
  raise CommandExecutionError('No suitable config file found')
 config = configparser.ConfigParser()
 try:
  config.read(conf_file)
 except (IOError, OSError) as exc:
  raise CommandExecutionError('Unable to read from {0}: {1}'.format(conf_file, exc))
 return config

def _read_config ( conf_file = None ) : if ( conf_file is None ) : paths = ( '/etc/supervisor/supervisord.conf' , '/etc/supervisord.conf' ) for path in paths : if os . path . exists ( path ) : conf_file = path break if ( conf_file is None ) : raise CommandExecutionError ( 'No suitable config file found' ) config = configparser . ConfigParser ( ) try : config . read ( conf_file ) except ( IOError , OSError ) as exc : raise CommandExecutionError ( 'Unable to read from {0}: {1}' . format ( conf_file , exc ) ) return config
reads the config file using configparser .