(ctx: CephadmContext)
| 3543 | |
| 3544 | @infer_fsid |
| 3545 | def 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 |
nothing calls this directly
no test coverage detected