INNER CODE UNIT · Python

__init__

timothystewart6/k3s-ansible · .github/scripts/test-default-interface.py:32

    def __init__(self, default_iface, iface_ip):
        self._default = {"interface": default_iface, "address": iface_ip}
        self._ifaces = {
            default_iface: {"ipv4": {"address": iface_ip}},
        }

    @property
    def default_ipv4(self):
        return self._default

    def __getitem__(self, key):
        return self._ifaces[key]


def read_all_yml(root):
    path = os.path.join(root, "inventory", "sample", "group_vars", "all.yml")
    with open(path, "r") as handle:
        return handle.read()

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…