def _parse_core_site():
 global _CORE_SITE_DICT
 global _CORE_SITE_PATH
 for indentifier in conf.HDFS_CLUSTERS.get():
  try:
   _CORE_SITE_PATH = os.path.join(conf.HDFS_CLUSTERS[indentifier].HADOOP_CONF_DIR.get(), 'core-site.xml')
   data = file(_CORE_SITE_PATH, 'r').read()
   break
  except KeyError:
   data = ''
  except IOError as err:
   if (err.errno != errno.ENOENT):
    LOG.error(('Cannot read from "%s": %s' % (_CORE_SITE_PATH, err)))
    return
   data = ''
 _CORE_SITE_DICT = confparse.ConfParse(data)

def _parse_core_site ( ) : global _CORE_SITE_DICT global _CORE_SITE_PATH for indentifier in conf . HDFS_CLUSTERS . get ( ) : try : _CORE_SITE_PATH = os . path . join ( conf . HDFS_CLUSTERS [ indentifier ] . HADOOP_CONF_DIR . get ( ) , 'core-site.xml' ) data = file ( _CORE_SITE_PATH , 'r' ) . read ( ) break except KeyError : data = '' except IOError as err : if ( err . errno != errno . ENOENT ) : LOG . error ( ( 'Cannot read from "%s": %s' % ( _CORE_SITE_PATH , err ) ) ) return data = '' _CORE_SITE_DICT = confparse . ConfParse ( data )
parse core-site .