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

Function command_logs

src/cephadm/cephadm.py:3545–3561  ·  view source on GitHub ↗
(ctx: CephadmContext)

Source from the content-addressed store, hash-verified

3543
3544@infer_fsid
3545def command_logs(ctx: CephadmContext) -> None:
3546 ident = identify(ctx)
3547 unit_name = lookup_unit_name_by_daemon_name(
3548 ctx, ident.fsid, ident.daemon_name
3549 )
3550 cmd = [find_program('journalctl')]
3551 cmd.extend(['-u', unit_name])
3552 if ctx.command:
3553 cmd.extend(ctx.command)
3554
3555 if ctx.dry_run:
3556 print(' '.join(shlex.quote(arg) for arg in cmd))
3557 return
3558 # call this directly, without our wrapper, so that we get an unmolested
3559 # stdout with logger prefixing.
3560 logger.debug('Running command: %s' % ' '.join(cmd))
3561 subprocess.call(cmd, env=os.environ.copy()) # type: ignore
3562
3563##################################
3564

Callers

nothing calls this directly

Calls 9

identifyFunction · 0.90
find_programFunction · 0.90
printFunction · 0.85
extendMethod · 0.80
joinMethod · 0.45
debugMethod · 0.45
callMethod · 0.45
copyMethod · 0.45

Tested by

no test coverage detected