MCPcopy Create free account
hub / github.com/ceph/ceph / get

Function get

src/script/ptl-tool.py:300–328  ·  view source on GitHub ↗
(session, url, params=None, paging=True)

Source from the content-addressed store, hash-verified

298 return f'* "PR #{pr}":{response["html_url"]} -- {response["title"].strip()}'
299
300def get(session, url, params=None, paging=True):
301 if params is None:
302 params = {}
303 params['per_page'] = 100
304
305 log.debug(f"Fetching {url}")
306 response = session.get(url, auth=GithubBearerAuth(), params=params)
307 log.debug(f"Response = {response}; links = {response.headers.get('link', '')}")
308
309 if response.status_code != 200:
310 log.error(f"Failed to fetch {url}: {response}")
311 sys.exit(1)
312 j = response.json()
313 yield j
314 if paging:
315 link = response.headers.get('link', None)
316 page = 2
317 while link is not None and 'next' in link:
318 log.debug(f"Fetching {url}")
319 new_params = dict(params)
320 new_params.update({'page': page})
321 response = session.get(url, auth=GithubBearerAuth(), params=new_params)
322 log.debug(f"Response = {response}; links = {response.headers.get('link', '')}")
323 if response.status_code != 200:
324 log.error(f"Failed to fetch {url}: {response}")
325 sys.exit(1)
326 yield response.json()
327 link = response.headers.get('link', None)
328 page += 1
329
330def resolve_ref(G, ref, remote_url, always_fetch=False):
331 """

Callers 15

get_pr_infoFunction · 0.70
get_creditsFunction · 0.70
build_branchFunction · 0.70
existsMethod · 0.50
linkMethod · 0.50
readMethod · 0.50
read_modify_writeMethod · 0.50
igetMethod · 0.50
getMethod · 0.50
factoryMethod · 0.50
loadMethod · 0.50
getMethod · 0.50

Calls 7

GithubBearerAuthClass · 0.85
debugMethod · 0.45
getMethod · 0.45
errorMethod · 0.45
exitMethod · 0.45
jsonMethod · 0.45
updateMethod · 0.45

Tested by 9

TEST_FFunction · 0.40
TestIoCtxImplMethod · 0.40
TestRadosClientMethod · 0.40
TEST_FFunction · 0.40
expect_image_syncMethod · 0.40
getMethod · 0.40
getMethod · 0.40
getMethod · 0.40