From d3c6a5369f0c539421525de73d5624bdfdd5a6ea Mon Sep 17 00:00:00 2001 From: Denys Fedoryshchenko Date: Tue, 7 May 2024 10:01:46 +0300 Subject: [PATCH] config/runtime: Add support for parameter "platforms" We might have limited set of platforms available in certain lab. Lab owners should have option to define such list. As per suggestion: https://github.com/kernelci/kernelci-project/issues/350#issuecomment-2096625245 Signed-off-by: Denys Fedoryshchenko --- kernelci/config/runtime.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/kernelci/config/runtime.py b/kernelci/config/runtime.py index 3c094b5991..582eae4de1 100644 --- a/kernelci/config/runtime.py +++ b/kernelci/config/runtime.py @@ -85,7 +85,7 @@ class RuntimeLAVA(Runtime): # pylint: disable=too-many-arguments def __init__(self, url, priority=None, priority_min=None, priority_max=None, queue_timeout=None, notify=None, - **kwargs): + platforms=None, **kwargs): super().__init__(**kwargs) def _set_priority_value(value, default): @@ -97,6 +97,10 @@ def _set_priority_value(value, default): self._priority_max = _set_priority_value(priority_max, self._priority) self._notify = notify or {} self._queue_timeout = queue_timeout + # set platforms is list or None + if platforms and not isinstance(platforms, list): + raise ValueError('platforms must be a list') + self._platforms = platforms @property def url(self): @@ -132,6 +136,12 @@ def notify(self): """Callback parameters for the `notify` part of the jobs""" return self._notify.copy() + @property + def platforms(self): + """List of platforms supported by the lab""" + return self._platforms + + @classmethod def _get_yaml_attributes(cls): attrs = super()._get_yaml_attributes() @@ -142,6 +152,7 @@ def _get_yaml_attributes(cls): 'queue_timeout', 'url', 'notify', + 'platforms', }) return attrs