Update to support new auto structure (#298)

See https://github.com/endoflife-date/endoflife.date/pull/4570.
This commit is contained in:
Marc Wrobel
2024-02-07 23:11:31 +01:00
parent c89cbf03af
commit 8f459f2bc3

View File

@@ -62,12 +62,12 @@ class ProductFrontmatter:
def get_auto_configs(self, method: str) -> list[AutoConfig]:
configs = []
if "auto" in self.data:
for config in self.data["auto"]:
if method in config:
configs.append(AutoConfig(method, config))
all_configs = self.data.get("auto", {}).get("methods", [])
for config in all_configs:
if method in config:
configs.append(AutoConfig(method, config))
if len(configs) > 0 and len(configs) != len(self.data["auto"]):
if len(configs) > 0 and len(configs) != len(all_configs):
message = f"mixed auto-update methods declared for {self.name}, this is not yet supported"
raise ValueError(message)