File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -75,6 +75,10 @@ def __init__(
7575 parent : Optional [tmt .utils .Common ] = None ,
7676 logger : tmt .log .Logger ,
7777 ) -> None :
78+ from tmt .steps .discover .fmf import (
79+ DiscoverFmf , # pyright: ignore[reportUnknownVariableType]
80+ )
81+
7882 super ().__init__ (parent = parent , logger = logger )
7983
8084 # Default branch is detected from the origin after cloning
@@ -111,9 +115,11 @@ def __init__(
111115 self .url = identifier .url
112116 self .path = identifier .path
113117 if not self .url and not self .path :
114- raise tmt .utils .SpecificationError (
115- "Need 'url' or 'path' to fetch a beakerlib library."
116- )
118+ # Default the path to TMT_TREE for the cases where the beakerlib library is
119+ # next to the tmt metadata.
120+ # FIXME: it seems self.parent is always a `DiscoverFmf`?
121+ assert isinstance (self .parent , DiscoverFmf )
122+ self .path = self .parent .step .plan .worktree
117123 # Strip the '.git' suffix from url for known forges
118124 if self .url :
119125 for forge in STRIP_SUFFIX_FORGES :
Original file line number Diff line number Diff line change @@ -146,12 +146,6 @@ definitions:
146146 required :
147147 - type
148148
149- anyOf :
150- - required :
151- - url
152- - required :
153- - path
154-
155149 # This would have been the easy way, understandable by newer jsonschema
156150 # packages.
157151 # url: true
You can’t perform that action at this time.
0 commit comments