Skip to content

angee.platform_integrate_operator.installer

The operator AddonInstaller backend — settings.yaml editing over the operator.

The :class:~angee.platform.installer.AddonInstaller owns the comment-preserving INSTALLED_APPS edit; a backend is pure transport. This one routes that transport through the operator daemon: the operator owns the deployment's settings.yaml and the rebuild lifecycle, so the read/write go over its file API and the rebuild over POST /stack/build (which rebuilds and restarts the django service). The read's etag is carried to the write so a concurrent edit fails the write rather than silently clobbering it.

OperatorInstallerBackend

python
class OperatorInstallerBackend(AddonInstallerBackend)

Production transport: edit app/settings.yaml + rebuild through the operator.

read_settings_text seeds :attr:_etag from the operator read; the matching write_settings_text echoes it for the daemon's optimistic-concurrency check (the two run within one AddonInstaller.install/uninstall call on this one instance). An unconfigured or unreachable daemon surfaces as FileNotFoundError on the read, which the installer turns into a clean refusal rather than a crash.

__init__

python
def __init__() -> None

Resolve the operator daemon from settings; the read seeds the write etag.

read_settings_text

python
def read_settings_text() -> str

Return app/settings.yaml via the operator, seeding the concurrency etag.

Any transport-layer failure (daemon unconfigured, unreachable, or an HTTP error) becomes FileNotFoundError so the installer reports a refusal — the read is the gate before any edit, so a broken transport never half-applies.

write_settings_text

python
def write_settings_text(text: str) -> None

Write the edited app/settings.yaml back through the operator with the read etag.

request_rebuild

python
def request_rebuild() -> str

Trigger the operator rebuild + restart (POST /stack/build).

Released under the AGPL-3.0 License.