Doctor¶
End-to-end diagnostics for a configured Moodle environment.
Composes the existing configuration, session, compatibility, and site-info building blocks into a single, read-only health report for a Moodle environment. Never mutates remote state and never surfaces raw secret values (password, webservice token, sesskey) in any check message.
Classes:
| Name | Description |
|---|---|
CheckStatus |
Outcome of a single diagnostic check. |
CheckResult |
Result of a single diagnostic check. |
DoctorReport |
Aggregate result of running all doctor checks for one environment. |
Functions:
| Name | Description |
|---|---|
run_diagnostics |
Run all doctor checks for a Moodle environment. |
Attributes:
| Name | Type | Description |
|---|---|---|
CRITICAL_CHECKS |
|
Attributes¶
Classes¶
CheckStatus ¶
CheckResult
dataclass
¶
CheckResult(name: str, status: CheckStatus, message: str)
Result of a single diagnostic check.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
Short machine-friendly identifier (e.g. "login"). |
status |
CheckStatus
|
One of CheckStatus.PASS/WARN/FAIL. |
message |
str
|
Human-readable detail. MUST NOT contain raw secret values (password, webservice token, sesskey). |
Attributes¶
DoctorReport
dataclass
¶
DoctorReport(env: str, checks: List[CheckResult] = list())
Functions:¶
run_diagnostics ¶
run_diagnostics(env: str) -> DoctorReport
Run all doctor checks for a Moodle environment.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
env
|
str
|
Environment key passed to load_settings/MoodleSession.get. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
DoctorReport |
DoctorReport
|
Aggregate report. Individual checks never raise; |
DoctorReport
|
each failure is captured as a CheckResult with status FAIL/WARN. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If load_settings(env) cannot resolve required configuration (propagated so the CLI can map it to exit code 2, distinct from a failed check). |