def is_installed(name): with ctx.settings(warn_only=True): res = run("dpkg -s %s" % name) for line in res.splitlines(): if line.startswith("Status: "): status = line[8:] if "installed" in status.split(" "): return True return False
def is_running(): with ctx.settings(warn_only=True): command = "vagrant status | egrep -o 'running$'" vm_running = local(command, capture=True) if vm_running == None or vm_running == "": return False return True
def is_running(): with ctx.settings(warn_only=True): command = "vagrant status | egrep -o 'running$'" vm_running = core.local(command, capture=True) if vm_running is None or vm_running == "": return False return True
def is_installed(name): with ctx.settings(warn_only=True): res = core.run("dpkg -s %s" % name) for line in res.splitlines(): if line.startswith("Status: "): status = line[8:] if "installed" in status.split(" "): return True return False
def is_running(name): with ctx.settings(warn_only=True): res = core.sudo("/etc/init.d/%s status" % name) return res.succeeded