示例#1
0
文件: agent.py 项目: NoOnouz/oio-sds
    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)
示例#2
0
    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)