Skip to content

Commit 9a5fdaf

Browse files
committed
squash: get path only in fmf discover plugin
1 parent 73b730e commit 9a5fdaf

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

tmt/steps/discover/__init__.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -320,11 +320,10 @@ def _fetch_remote_source(self, url: str) -> None:
320320
f"url-content-type has unsupported value: {self.data.url_content_type}"
321321
)
322322

323-
def _fetch_local_repository(self, path: Optional[Path]) -> Optional[Path]:
323+
def _fetch_local_repository(self) -> Optional[Path]:
324324
"""
325325
Fetch local repository.
326326
327-
:param path: Potential path to the local repository.
328327
:returns: Path to the root of the metadata tree within the copied repository.
329328
"""
330329
raise NotImplementedError
@@ -335,9 +334,9 @@ def fetch_source(self) -> Path:
335334
336335
:returns: Path to the root of the metadata tree within the fetched source.
337336
"""
338-
path = Path(self.get('path')) if self.get('path', None) else None
337+
path: Optional[Path] = None
339338
if self.data.url is None:
340-
path = self._fetch_local_repository(path=path)
339+
path = self._fetch_local_repository()
341340
else:
342341
self._fetch_remote_source(url=self.data.url)
343342

tmt/steps/discover/fmf.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,8 @@ def is_in_standalone_mode(self) -> bool:
468468
return True
469469
return super().is_in_standalone_mode
470470

471-
def _fetch_local_repository(self, path: Optional[Path]) -> Optional[Path]:
471+
def _fetch_local_repository(self) -> Optional[Path]:
472+
path = Path(self.data.path) if self.data.path is not None else None
472473
if path is not None:
473474
fmf_root: Optional[Path] = path
474475
else:

tmt/steps/discover/shell.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ def show(self, keys: Optional[list[str]] = None) -> None:
291291
if self.data.tests:
292292
click.echo(tmt.utils.format('tests', [test.name for test in self.data.tests]))
293293

294-
def _fetch_local_repository(self, path: Optional[Path]) -> Optional[Path]:
294+
def _fetch_local_repository(self) -> Optional[Path]:
295295
assert self.step.plan.worktree # narrow type
296296

297297
# Symlink tests directory to the plan work tree

0 commit comments

Comments
 (0)