Example #1
0
def snap_refresh():
    channel = config('channel') or 'stable'
    if validate_snap_channel(channel):
        clear_flag('snap.channel.invalid')
        snap.refresh('vault', channel=channel)
        if vault.can_restart():
            log("Restarting vault", level=DEBUG)
            service_restart('vault')
            if config('totally-unsecure-auto-unlock'):
                vault.prepare_vault()
    else:
        set_flag('snap.channel.invalid')
Example #2
0
def refresh():
    opts = layer.options('snap')
    # supported-architectures is EXPERIMENTAL and undocumented.
    # It probably should live in the base layer, blocking the charm
    # during bootstrap if the arch is unsupported.
    arch = uname()[4]
    for snapname, snap_opts in opts.items():
        supported_archs = snap_opts.pop('supported-architectures', None)
        if supported_archs and arch not in supported_archs:
            continue
        snap.refresh(snapname, **snap_opts)
    snap.connect_all()
Example #3
0
def refresh():
    # Do nothing if we don't have kernel support yet
    if not kernel_supported():
        return

    opts = sorted_snap_opts()
    # supported-architectures is EXPERIMENTAL and undocumented.
    # It probably should live in the base layer, blocking the charm
    # during bootstrap if the arch is unsupported.
    arch = uname()[4]
    for snapname, snap_opts in opts.items():
        supported_archs = snap_opts.pop('supported-architectures', None)
        if supported_archs and arch not in supported_archs:
            continue
        snap.refresh(snapname, **snap_opts)
    snap.connect_all()
Example #4
0
def refresh():
    opts = layer.options('snap')
    for snapname, snap_opts in opts.items():
        snap.refresh(snapname, **snap_opts)
    snap.connect_all()
Example #5
0
def refresh():
    opts = layer.options('snap')
    for snapname, snap_opts in opts.items():
        snap.refresh(snapname, **snap_opts)
    snap.connect_all()