Perhaps this layer should do nothing at all if install_method is set to apt

Bug #1828055 reported by Tilman Baumann on 2019-05-07
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Snap Layer
Undecided
Unassigned

Bug Description

Some/A lot of charms allow selecting different install methods. Either snap or apt.

Perhaps this snap should do nothing at all when the config value `install_method` exists and is set to apt.
It seems unnecessary to install snapd at module load time if it's not going to be used.

Tilman Baumann (tilmanbaumann) wrote :

How about

install_method = hookenv.config()['install_method']
if not hasattr(reactive, '_snap_registered') and not install_method == 'apt':
    hookenv.atstart(hookenv.log, 'Initializing Snap Layer')
    hookenv.atstart(ensure_snapd)
    hookenv.atstart(ensure_path)
    hookenv.atstart(update_snap_proxy)
    hookenv.atstart(configure_snap_enterprise_proxy)
    hookenv.atstart(install)
    reactive._snap_registered = True

This layer is a total pain on trusty and especially in trusty containers.
What's worst about is, it fails even though it will not even be used by the charm.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers