Re: [libvirt-ci PATCH 06/13] lcitool: Introduce methods to load and validate the TOML config

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2020-04-22 at 15:28 +0200, Erik Skultety wrote:
> +    @staticmethod
> +    def _fill_default_options(cfg):
> +        flavor = cfg.get("install").get("flavor", "test")
> +        cfg["install"]["flavor"] = flavor
> +
> +        if flavor == "gitlab":
> +            url = cfg.get("gitlab").get("gitlab_url", "https://gitlab.com";)
> +            cfg["gitlab"]["gitlab_url"] = url

The key should be "url" here...

> +    def _validate(self):
> +
> +        # verify the [install] section and its mandatory options
> +        self._validate_section(self.dict, "install", "root_password")
> +
> +        # we need to check flavor here, because later validations depend on it
> +        flavor = self.dict.get("install").get("flavor", "test")
> +        if flavor not in ["test", "jenkins", "gitlab"]:
> +            raise ValueError(
> +                "Invalid value '{}' for 'install.flavor'".format(flavor)
> +            )
> +
> +        # verify the optional [gitlab] section and its mandatory options
> +        if flavor == "gitlab":
> +            self._validate_section(self.dict, "gitlab", "gitlab_runner_secret")

... and "runner_secret" here.

-- 
Andrea Bolognani / Red Hat / Virtualization




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux