28. (Machines only) Remove duplicate hardcoded snap info
Remove information that is hardcoded in the charm code and that duplicates the snap section of refresh_versions.toml.
Example refresh_versions.toml snap section
[snap]
name = "charmed-postgresql" (1)
[snap.revisions] (2)
# amd64
x86_64 = "182"
# arm64
aarch64 = "181"
Snap name
Replace the hardcoded snap name (e.g. "charmed-postgresql") with:
-
the CharmSpecific.refresh_snap method’s
snap_name
parameter or -
(outside of refresh_snap)
charm_refresh.snap_name()
Snap revisions
Replace hardcoded snap revision(s) (e.g. "182", "181") with:
-
the CharmSpecific.refresh_snap method’s
snap_revision
parameter or -
charm_refresh.Machines().pinned_snap_revision
pinned_snap_revision
must only be used during the initial snap installation and must not be used to refresh the snap