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

Function pull_image

qa/tasks/cephadm.py:577–603  ·  view source on GitHub ↗
(ctx, config)

Source from the content-addressed store, hash-verified

575
576@contextlib.contextmanager
577def pull_image(ctx, config):
578 cluster_name = config['cluster']
579 log.info(f'Pulling image {ctx.ceph[cluster_name].image} on all hosts...')
580 cmd = [
581 'sudo',
582 ctx.cephadm,
583 '--image',
584 ctx.ceph[cluster_name].image,
585 'pull',
586 ]
587 if config.get('registry-login'):
588 registry = config['registry-login']
589 login_cmd = [
590 'sudo',
591 ctx.cephadm,
592 'registry-login',
593 '--registry-url', registry['url'],
594 '--registry-username', registry['username'],
595 '--registry-password', registry['password'],
596 ]
597 cmd = login_cmd + [run.Raw('&&')] + cmd
598 run.wait(ctx.cluster.run(args=cmd, wait=False))
599
600 try:
601 yield
602 finally:
603 pass
604
605
606@contextlib.contextmanager

Callers 1

taskFunction · 0.85

Calls 4

infoMethod · 0.45
getMethod · 0.45
waitMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected