Loads the configuration from YAML, if no override config was passed in initially.
542759
def _load_config(self):
        

        if (
            self.config
        ):  # any config being pre-set at init will short circuit out, but not a plain {}
            return

        # Verify that we're in a project
        repo_root = self.repo_root
        if not repo_root:
            raise NotInProject(
                "No git repository was found in the current path. You must be in a git repository to set up and use CCI for a project."
            )

        # Verify that the project's root has a config file
        if not self.config_project_path:
            raise ProjectConfigNotFound(
                "The file {} was not found in the repo root: {}. Are you in a CumulusCI Project directory?".format(
                    self.config_filename, repo_root
                )
            )

        # Load the project's yaml config file
        with open(self.config_project_path, "r") as f_config:
            project_config = ordered_yaml_load(f_config)

        if project_config:
            self.config_project.update(project_config)

        # Load the local project yaml config file if it exists
        if self.config_project_local_path:
            with open(self.config_project_local_path, "r") as f_local_config:
                local_config = ordered_yaml_load(f_local_config)
            if local_config:
                self.config_project_local.update(local_config)

        # merge in any additional yaml that was passed along
        if self.additional_yaml:
            additional_yaml_config = ordered_yaml_load(self.additional_yaml)
            if additional_yaml_config:
                self.config_additional_yaml.update(additional_yaml_config)

        self.config = merge_config(
            OrderedDict(
                [
                    ("global_config", self.config_global),
                    ("global_local", self.config_global_local),
                    ("project_config", self.config_project),
                    ("project_local_config", self.config_project_local),
                    ("additional_yaml", self.config_additional_yaml),
                ]
            )
        )
1164528
def load_builtin_config(name, module_name=__name__, specs_path=specs.__path__):
    
    config_path = Path(next(iter(specs_path)))
    config_path = config_path / PurePath(resource_filename(module_name, name + '.yaml'))
    return load_config(config_path)
1136615
def load_configuration(app_name):
    '''
    
    '''
    if sys.prefix == '/usr':
        conf_dir = '/etc'
        share_dir = '/usr/share'
    else:
        conf_dir = os.path.join(sys.prefix, 'etc')
        share_dir = os.path.join(sys.prefix, 'share')
    # Step 1: try to locate pynlp.yml
    yml_config = {}
    for fname in [
            '%s.yml'%(app_name,),
            os.path.expanduser('~/.%s.yml'%(app_name,)),
            os.path.join(conf_dir, '%s.yml'%(app_name,))]:
        if os.path.exists(fname):
            yml_config = yaml.load(open(fname))
            break
    try:
        data_dir = yml_config['paths']['data_dir']
    except KeyError:
        try:
            data_dir = os.environ[app_name.upper()]
        except KeyError:
            data_dir = os.path.join(share_dir, app_name)
    return AppContext(yml_config, data_dir)
1188215
function loadConfigFile(file) {
    const filePath = file.filePath;
    let config;

    switch (path.extname(filePath)) {
        case '.yaml':
        case '.yml':
            config = loadYAMLConfigFile(filePath);
            break;

        default:
            config = loadJSONConfigFile(filePath);
    }

    return ConfigOps.merge(ConfigOps.createEmptyConfig(), config);
}
769071
def _load_yaml_config(path=None):
    """"""
    furious_yaml_path = path or find_furious_yaml()
    if furious_yaml_path is None:
        logging.debug("furious.yaml not found.")
        return None

    with open(furious_yaml_path) as yaml_file:
        return yaml_file.read()
460235
def load(self, file=CONFIG_FILE):
        
        if not os.path.exists(file):
            print("Config file was not found under %s. Default file has been created" % CONFIG_FILE)
            self._settings = yaml.load(DEFAULT_CONFIG, yaml.RoundTripLoader)
            self.save(file)
            sys.exit()
        with open(file, 'r') as f:
            self._settings = yaml.load(f, yaml.RoundTripLoader)
1405
def load_config
      (symbolise = lambda do |h|
        h.is_a?(Hash) ? Hash[h.map { |k, v| [k.intern, symbolise[v]] }] : h
      end)[YAML.load_file CONFIG] if File.readable? CONFIG
    rescue => e
      warn "Failed to load #{ CONFIG }: #{ e }"
    end
24149
def load_config_file(config_file_path, config_file):
    

    if config_file_path.lower().endswith(".yaml"):
        return yaml.load(config_file)

    if any(config_file_path.lower().endswith(extension) for extension in INI_FILE_EXTENSIONS):
        return load_config_from_ini_file(config_file)

    # At this point we have to guess the format of the configuration file.
    try:
        return yaml.load(config_file)
    except yaml.YAMLError:
        pass

    try:
        return load_config_from_ini_file(config_file)
    except:
        pass

    raise Exception("Could not load configuration file!")
275067
def load_config(value)
        return value unless value.is_a?(String)

        if value =~ /^http/
          begin open(value)
            YAML.load open(value).read
          rescue
            puts "#{value} not accessible"
            {}
          end
        elsif File.exist?(value)
          YAML.load_file(value)
        else
          puts "#{value} not found"
          {}
        end

      end
502233
def load_cfg(self):
        ''''''
        if self.cfg_mode == 'json':
            with open(self.cfg_file) as opened_file:
                return json.load(opened_file)
        else:
            with open(self.cfg_file) as ymlfile:
                return yaml.safe_load(ymlfile)
95206
def get_config(config, default_config):
    ''''''
    if not config:
        logging.warning('Using default config: %s', default_config)
        config = default_config

    try:
        with open(config, 'r') as config_file:
            return yaml.load(config_file)
    except (yaml.reader.ReaderError,
            yaml.parser.ParserError,
            yaml.scanner.ScannerError) as e:
        raise ConfigError('Invalid yaml file: \n %s' % str(e))
1120932
def _load_config(self):
        
        # load the global config
        with open(self.config_global_path, "r") as f_config:
            config = ordered_yaml_load(f_config)
        self.config_global = config

        # Load the local config
        if self.config_global_local_path:
            config = ordered_yaml_load(open(self.config_global_local_path, "r"))
            self.config_global_local = config

        self.config = merge_config(
            OrderedDict(
                [
                    ("global_config", self.config_global),
                    ("global_local", self.config_global_local),
                ]
            )
        )
1176075
def _load_config(self):
        
        if not os.path.exists(self._path):
            sys.exit("Config path %s does not exist" % self._path)
        # create empty config object
        self._config_dict = {}
        # read file and marshal yaml
        with open(self._path, 'r') as f:
            self._raw = f.read()
            self._config_dict = yaml.load(self._raw)
297668
def load_config():
    
    configuration = MyParser()
    configuration.read(_config)

    d = configuration.as_dict()

    if 'jira' not in d:
        raise custom_exceptions.NotConfigured

    # Special handling of the boolean for error reporting
    d['jira']['error_reporting'] = configuration.getboolean('jira', 'error_reporting')

    return d
586647
def load(self):
        
        data = self.dict_class()
        
        for path in self.paths:
            if path in self.paths_loaded: continue
            
            try:
                with open(path, 'r') as file:
                    path_data = yaml.load(file.read())
                    data = dict_merge(data, path_data)
                self.paths_loaded.add(path)
            except IOError:
                # TODO: Log this correctly once logging is implemented
                if not path.endswith('.local.yml'):
                    print 'CONFIG NOT FOUND: %s' % (path)

        self.data = data
809633
def get_config(config_file):
    """"""
    def load(fp):
        try:
            return yaml.safe_load(fp)
        except yaml.YAMLError as e:
            sys.stderr.write(text_type(e))
            sys.exit(1)  # TODO document exit codes

    if config_file == '-':
        return load(sys.stdin)
    if not os.path.exists(config_file):
        sys.stderr.write('ERROR: Must either run next to config.yaml or'
            ' specify a config file.\n' + __doc__)
        sys.exit(2)
    with open(config_file) as fp:
        return load(fp)
15498
def load_config(path):
   
   with path.open('rb') as fi:
       file_bytes = fi.read()
       config = yaml.load(file_bytes.decode('utf-8'))

   return config