Skip to main content

KernelDB.check_report()

Everything the check command reports, as data (#46).

Usage

Source

KernelDB.check_report(
    mk_path, *, mission=None, hash_=False, remote=False, spice=False
)

Runs check_metakernel (present), verify_metakernel (resolves, with SHA-256 checks when hash_ is set) and, only when remote is set, verify_against_server and newer_remote_version. Those two are the only network calls. check_metakernel itself prints nothing and touches no network.

The three verdicts, each a bit of the exit code, are:

  • 1, present: every kernel of the metakernel is on disk;
  • 2, resolves: every entry resolves soundly through PATH_VALUES and matches the database;
  • 4, matches remote: every local kernel matches the server (only with remote).

Parameters

mk_path: str | Path

Any reference resolve_metakernel accepts.

mission: str | None = None

Mission name for preferred-mission resolution.

hash_: bool = False

Verify SHA-256 hashes: recompute them for the resolves verdict and, with remote, compare them against the server.

remote: bool = False

Compare the local kernels with the server. This is the one network path.

spice: bool = False
With remote, also furnsh each local kernel in an isolated kernel pool and report what SPICE refuses to read. Needs SpiceyPy.

Returns

dict

With the keys:

  • mk_path: the resolved path, as a string
  • present: the raw result of check_metakernel
  • resolves: the raw result of verify_metakernel
  • remote: the raw result of verify_against_server, or None without remote
  • newer: the newer-version notice, or None
  • verdicts: the three verdicts as {bit, ok, line} rows. ok is True, False, or None when the verdict was not checked
  • exit_code: the sum of the failed verdicts’ bits, 0 to 7

Raises

MetakernelNotTracked

mk_path matches nothing.

AmbiguousMetakernel
mk_path matches several registry rows.