From: John Mulligan Date: Thu, 2 May 2024 20:39:34 +0000 (-0400) Subject: mgr/smb: allow ResultGroup to take an initial list of results X-Git-Tag: v20.0.0~1709^2~7 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8bc772c65aa3e5429f1961717a448f9f00ca8f8d;p=ceph.git mgr/smb: allow ResultGroup to take an initial list of results Can save a line of code later. Signed-off-by: John Mulligan --- diff --git a/src/pybind/mgr/smb/results.py b/src/pybind/mgr/smb/results.py index e6a2bb83e07b..77bda1e6a29a 100644 --- a/src/pybind/mgr/smb/results.py +++ b/src/pybind/mgr/smb/results.py @@ -1,4 +1,4 @@ -from typing import Iterator, List, Optional +from typing import Iterable, Iterator, List, Optional import errno @@ -84,8 +84,10 @@ class ResultGroup: # Compatible with object formatter, thus suitable for being returned # directly to mgr module. - def __init__(self) -> None: - self._contents: List[Result] = [] + def __init__( + self, initial_results: Optional[Iterable[Result]] = None + ) -> None: + self._contents: List[Result] = list(initial_results or []) def append(self, result: Result) -> None: self._contents.append(result)