INNER CODE UNIT · Python

pkg_manager

LINBIT/linstor-server · scripts/linstor-controller-ha-setup.py:256

def pkg_manager():
    """The node's package manager, as (name, install-cmd, refresh-cmd)."""
    for name, install, refresh in (
            ("apt-get", ["apt-get", "install", "-y"], ["apt-get", "update", "-q"]),
            ("dnf", ["dnf", "install", "-y"], None),
            ("yum", ["yum", "install", "-y"], None),
            ("zypper", ["zypper", "--non-interactive", "install"], None)):
        if shutil.which(name):
            return name, install, refresh
    return None, None, None


_pkg_lists_refreshed = []


def refresh_pkg_lists():
    """Bring the package lists up to date, at most once per run.

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…