def _get_config_for_all_services(self, session):
services_dict = self._load_provider_configs()
configs_path = self._get_configs_path()
with open(configs_path) as jsonf:
services_dict = Record(**json.load(jsonf)).services
pending = []
base = self._disco.get_base_uri()
for service in self._provider_config.services:
if service in self.SERVICES_MAP.keys():
for subservice in self.SERVICES_MAP[service]:
uri = base + str(services_dict[subservice])
path = self._get_service_config_path(subservice)
if session:
d = session.fetch_provider_configs(
uri, path, method='GET')
else:
d = self._fetch_provider_configs_unauthenticated(
uri, path, method='GET')
pending.append(d)
return defer.gatherResults(pending)
评论列表
文章目录