def is_installed(pkg_name):
    manager = MANAGER

    with settings(hide("running", "stdout", "stderr", "warnings"),
                  warn_only=True):
        res = run("%(manager)s -p %(pkg_name)s" % locals())

    if not res.succeeded:
        return False

    if pkg_name.startswith("="):
        # The =, which is required when installing/checking for absolute
        # versions, will not appear in the results.
        pkg_name = pkg_name[1:]

    match = re.search(
            r"\n\[ebuild +(?P<code>\w+) *\] .*%(pkg_name)s.*" % locals(),
            res.stdout)
    if match and match.groupdict()["code"] in ("U", "R"):
        return True
    else:
        return False
Reboot the node by passing in the node object
dataset/ETHPy150Open ronnix/fabtools/fabtools/portage.py/is_installed--crossover with--dataset/ETHPy150Open infincia/AEServmon/libcloud/drivers/ec2.py/EC2NodeDriver.reboot_node