pyfsr.cli.appliance.license

pyfsr appliance license — licensing / identity verbs.

The device UUID is the value that eats sessions: it doubles as the cyberpgsql / elastic password, and on a FortiCloud-drifted box the entitlement UUID that csadm reports diverges from the install-time UUID that the DB/ES passwords were provisioned with — so csadm’s value silently fails Postgres auth (see facts). license drift makes that mismatch a first-class, gate-able check instead of a half-session mystery.

Classes

LicenseDetails

Parsed csadm license --show-details identity card.

DriftReport

Result of comparing the install-time UUID against csadm's entitlement UUID.

Functions

show(→ str)

Raw csadm license --show-details output. For a typed result use details().

details(→ LicenseDetails)

Typed csadm license --show-details — edition, expiry, user count, UUID.

device_uuid_from_file(→ str | None)

The install-time device UUID from /home/csadmin/device_uuid (no sudo).

device_uuid_from_csadm(→ str | None)

The current entitlement device UUID from csadm (needs root).

device_uuid(→ str)

The device UUID to use as the DB/ES password: file first, csadm fallback.

drift(→ DriftReport)

Compare the install-time file UUID against csadm's entitlement UUID.

Module Contents

class pyfsr.cli.appliance.license.LicenseDetails[source]

Parsed csadm license --show-details identity card.

total_users / remaining_days are typed ints; fields keeps every raw key: value pair so uncommon keys are still reachable.

type: str | None[source]
edition: str | None[source]
role: str | None[source]
total_users: int | None[source]
expiry_date: str | None[source]
remaining_days: int | None[source]
serial_no: str | None[source]
device_uuid: str | None[source]
fields: dict[str, str][source]
pyfsr.cli.appliance.license.show(transport: pyfsr.cli.appliance.transport.Transport) str[source]

Raw csadm license --show-details output. For a typed result use details().

pyfsr.cli.appliance.license.details(transport: pyfsr.cli.appliance.transport.Transport) LicenseDetails[source]

Typed csadm license --show-details — edition, expiry, user count, UUID.

pyfsr.cli.appliance.license.device_uuid_from_file(transport: pyfsr.cli.appliance.transport.Transport) str | None[source]

The install-time device UUID from /home/csadmin/device_uuid (no sudo).

This is the authoritative DB/ES password value. Returns None if the file is absent or unreadable.

pyfsr.cli.appliance.license.device_uuid_from_csadm(transport: pyfsr.cli.appliance.transport.Transport) str | None[source]

The current entitlement device UUID from csadm (needs root).

On a FortiCloud-drifted box this differs from the file value and will fail cyberpgsql auth. Returns None if csadm fails.

pyfsr.cli.appliance.license.device_uuid(transport: pyfsr.cli.appliance.transport.Transport) str[source]

The device UUID to use as the DB/ES password: file first, csadm fallback.

Mirrors facts.Facts.device_uuid() so the verb and the DB layer agree on which value is authoritative.

class pyfsr.cli.appliance.license.DriftReport[source]

Result of comparing the install-time UUID against csadm’s entitlement UUID.

file_uuid: str | None[source]
csadm_uuid: str | None[source]
drifted: bool[source]
verdict: str[source]
pyfsr.cli.appliance.license.drift(transport: pyfsr.cli.appliance.transport.Transport) DriftReport[source]

Compare the install-time file UUID against csadm’s entitlement UUID.

A drift means csadm’s value would fail Postgres/ES auth; the file value (used by the DB layer) is the one that still works. Either source missing is reported rather than silently treated as a match.