Add `sorted_dependencies` a light wrapper around get_dependencies that
enforces the invariant of returning a sorted list of dependencies.
In the future we may want to simply replace get_dependencies if
there's no place we don't want sorted dependencies but this keeps
the changes to a minimum for now.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
) -> List[str]:
return []
+ @classmethod
+ def sorted_dependencies(
+ cls,
+ mgr: "CephadmOrchestrator",
+ spec: Optional[ServiceSpec] = None,
+ daemon_type: Optional[str] = None,
+ ) -> List[str]:
+ """A version of get_dependencies that guarantees that the returned
+ list is in sorted order.
+ """
+ return sorted(cls.get_dependencies(mgr, spec, daemon_type))
+
def __init__(self, mgr: "CephadmOrchestrator"):
self.mgr: "CephadmOrchestrator" = mgr