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
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
def check_snap_installed(self, snapname): """Verify a snap is installed.""" return snap.is_installed(snapname)