def _get_repository(repository_id):
"""Get a repository from the accounts service
:param repository_id: str
:returns: repository resource
:raises: koi.exceptions.HTTPError
"""
client = API(options.url_accounts, ssl_options=ssl_server_options())
try:
repo = yield client.accounts.repositories[repository_id].get()
raise Return(repo)
except httpclient.HTTPError as exc:
if exc.code == 404:
msg = 'Unknown repository ID'
else:
msg = 'Unexpected error'
raise exceptions.HTTPError(exc.code, msg, source='accounts')
评论列表
文章目录