예제 #1
0
파일: powernv.py 프로젝트: tjjh89017/maas
 def get_params(self, backend, path):
     """Gets the matching parameters from the requested path."""
     match = re_config_file.match(path)
     if match is not None:
         return get_parameters(match)
     match = re_other_file.match(path)
     if match is not None:
         return get_parameters(match)
     return None
예제 #2
0
파일: grub.py 프로젝트: casual-lemon/maas
    def match_path(self, backend, path):
        """Checks path for the configuration file that needs to be
        generated.

        :param backend: requesting backend
        :param path: requested path
        :return: dict of match params from path, None if no match
        """
        match = re_config_file.match(path)
        if match is None:
            return None
        params = get_parameters(match)

        # MAC address is in the wrong format, fix it
        mac = params.get("mac")
        if mac is not None:
            params["mac"] = mac.replace(":", "-")

        # MAAS uses Debian architectures while GRUB uses standard Linux
        # architectures.
        arch = params.get("arch")
        if arch == "x86_64":
            params["arch"] = "amd64"
        elif arch in {"powerpc", "ppc64", "ppc64le"}:
            params["arch"] = "ppc64el"

        return params
예제 #3
0
    def match_path(self, backend, path):
        """Checks path for the configuration file that needs to be
        generated.

        :param backend: requesting backend
        :param path: requested path
        :return: dict of match params from path, None if no match
        """
        match = re_config_file.match(path)
        if match is None:
            return None
        return get_parameters(match)
예제 #4
0
    def match_path(self, backend, path):
        """Checks path for the configuration file that needs to be
        generated.

        :param backend: requesting backend
        :param path: requested path
        :return: dict of match params from path, None if no match
        """
        match = re_config_file.match(path)
        if match is None:
            return None
        params = get_parameters(match)

        # MAC address is in the wrong format, fix it
        mac = params.get("mac")
        if mac is not None:
            params["mac"] = mac.replace(":", "-")

        return params