[RFE] Define safe_install method that sets flag snap.failed.install when install/refresh fails instead of raise exception
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Snap Layer |
New
|
Undecided
|
Unassigned |
Bug Description
Installing charms that depend layer-snap may cause transient "error" status because command "snap install" or "snap refresh" failed to fetch .snap file from snapstore.
Charms pick-up and eventually finish installation if network is OK. However, juju-wait monitors for charms that error and returns if it finds one. That transient status ends up breaking automations we have that build on top of juju-wait or we need to exclude relevant charms from juju-wait monitor.
"snap install" and "snap refresh" happens only on install method on this charm. This method will raise an exception if snap call fails. We could have a second method (say, safe_install) that captures subprocess.
This method needs to remove this flag at beginning of its logic.