Skip to content

Commit

Permalink
Refactor code to remove unnecessary parts
Browse files Browse the repository at this point in the history
  • Loading branch information
Ismail Ibrahim Quwarah committed Nov 13, 2024
1 parent c651225 commit 274bdb5
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions tmt/steps/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1958,16 +1958,16 @@ def _login(
# Attempt to push the workdir to the guest
try:
guest.push()
worktree = self.parent.plan.worktree
test_path = self.parent.plan.discover.tests(
)[-1].path if self.parent.plan.discover.tests() else None
if not cwd:
worktree = self.parent.plan.worktree
tests = self.parent.plan.discover.tests()
test_path = tests[-1].path if tests else None

if worktree and test_path:
test_path = worktree.parent / "discover" / test_path.unrooted()
else:
test_path = worktree
if worktree and test_path:
cwd = worktree.parent / "discover" / test_path.unrooted()
else:
cwd = worktree

cwd = cwd or test_path
except tmt.utils.GeneralError:
self.warn("Failed to push workdir to the guest.")
cwd = None
Expand Down

0 comments on commit 274bdb5

Please sign in to comment.