コード例 #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
ファイル: agent.py プロジェクト: talent-tool-sets/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)