コード例 #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')
コード例 #2
0
ファイル: snap.py プロジェクト: yh742/kubernetes-deployment
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()
コード例 #3
0
ファイル: snap.py プロジェクト: ducks23/pgsqlcharm
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()
コード例 #4
0
ファイル: snap.py プロジェクト: mbruzek/layer-snap
def refresh():
    opts = layer.options('snap')
    for snapname, snap_opts in opts.items():
        snap.refresh(snapname, **snap_opts)
    snap.connect_all()
コード例 #5
0
ファイル: snap.py プロジェクト: buggtb/layer-drillbit
def refresh():
    opts = layer.options('snap')
    for snapname, snap_opts in opts.items():
        snap.refresh(snapname, **snap_opts)
    snap.connect_all()