def load_services(self): include_dir = self.conf.get('include_dir') self.conf['services'] = self.conf.get('services') or {} if include_dir: include_dir = os.path.expanduser(include_dir) cfgfiles = [os.path.join(include_dir, f) for f in os.listdir(include_dir) if re.match(r'.+\.(json|yml|yaml)$', f)] for cfgfile in cfgfiles: name = os.path.basename(cfgfile) name = os.path.splitext(name)[0] self.conf['services'][name] = parse_config(cfgfile)
def load_services(self): include_dir = self.conf.get('include_dir') self.conf['services'] = self.conf.get('services') or {} if include_dir: include_dir = os.path.expanduser(include_dir) cfgfiles = [ os.path.join(include_dir, f) for f in os.listdir(include_dir) if re.match(r'.+\.(json|yml|yaml)$', f) ] for cfgfile in cfgfiles: name = os.path.basename(cfgfile) name = os.path.splitext(name)[0] self.conf['services'][name] = parse_config(cfgfile)