INNER CODE UNIT · Python

missing_requirements

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

def missing_requirements(vip=None):
    """[(what, package)] for everything this node still needs. The controller
    itself is not listed — the script only runs where it is already active."""
    needed = []
    # "linstor" stands in for the whole linstor-client package: the script
    # imports its python-linstor library, and writes a CLI config for the
    # operator to use afterwards.
    for tool, pkg in (("linstor", "linstor-client"),
                      ("drbdadm", "drbd-utils"),
                      ("drbd-reactor", "drbd-reactor"),
                      ("mkfs.ext4", "e2fsprogs")):
        if shutil.which(tool) is None:
            needed.append((tool, pkg))
    if not unit_exists("linstor-satellite"):
        needed.append(("linstor-satellite.service", "linstor-satellite"))
    # The promoter only needs the OCF agent when a VIP was asked for.
    if vip and not os.path.exists(IPADDR2_AGENT):
        needed.append(("ocf:heartbeat:IPaddr2", ipaddr2_package()))

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…