Ejemplo n.º 1
0
    def system_requirements():
        """
        Check if all necessary packages are installed on system

        :return: None or raise exception if some tooling is missing
        """
        command_exists(
            "systemd-run", ["systemd-run", "--help"],
            "Command systemd-run does not seems to be present on your system. "
            "Do you have system with systemd?")
        command_exists(
            "machinectl", ["machinectl", "--no-pager", "--help"],
            "Command machinectl does not seems to be present on your system. "
            "Do you have system with systemd?")
Ejemplo n.º 2
0
    def system_requirements():
        """
        Check if all necessary packages are installed on system

        :return: None or raise exception if some tooling is missing
        """
        command_exists("systemd-nspawn",
            ["systemd-nspawn", "--version"],
            "Command systemd-nspawn does not seems to be present on your system"
            "Do you have system with systemd")
        command_exists(
            "machinectl",
            ["machinectl", "--no-pager", "--help"],
            "Command machinectl does not seems to be present on your system"
            "Do you have system with systemd")
        if "Enforcing" in run_cmd(["getenforce"], return_output=True, ignore_status=True):
            logger.error("Please disable selinux (setenforce 0), selinux blocks some nspawn operations"
                         "This may lead to strange behaviour")
Ejemplo n.º 3
0
Archivo: image.py Proyecto: pingf/conu
    def system_requirements():
        """
        Check if all necessary packages are installed on system

        :return: None or raise exception if some tooling is missing
        """
        command_exists("losetup", ["losetup", "-V"],
                       "losetup is not present on your system")
        command_exists("partprobe", ["partprobe", "-v"],
                       "partprobe is not present on your system")
        command_exists("mount", ["mount", "-V"],
                       "mount is not present on your system")
Ejemplo n.º 4
0
def test_command_exists():
    m = "msg"
    command_exists("printf", ["printf", "--version"], m)
    with pytest.raises(CommandDoesNotExistException) as exc:
        command_exists("printof", ["printof", "--versionotron"], m)
        assert exc.value.msg == m