コード例 #1
0
 def check_snap_installed(self, snapname):
     """Verify a snap is installed."""
     result = snap.is_installed(snapname)
     hookenv.log(
         "Checking if snap {} is installed: {}".format(snapname, result),
         hookenv.DEBUG,
     )
     return result
コード例 #2
0
def get_target_etcd_channel():
    """
    Check whether or not etcd is already installed. i.e. we're
    going through an upgrade.  If so, leave the etcd version alone,
    if we're a new install, we can set the default channel here.

    If the user has specified a version, then just return that.

    :return: String snap channel
    """
    channel = hookenv.config("channel")
    if channel == "auto":
        if snap.is_installed("etcd"):
            return False
        else:
            return "3.4/stable"
    else:
        return channel
コード例 #3
0
ファイル: lib_matrix.py プロジェクト: woutervb/charm-matrix
 def check_snap_installed(self, snapname):
     """Verify a snap is installed."""
     return snap.is_installed(snapname)