Skip to content

Improve path normalization with a fallback for non-existent paths #1979

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
May 12, 2025

Conversation

shatakshiiii
Copy link
Contributor

@shatakshiiii shatakshiiii commented May 5, 2025

SUMMARY

  • Fixes the FileNotFoundError for paths that do not exist.

  • Moves the cache path generation outside of the loop (unrelated to the above error, just found and corrected it)

@shatakshiiii shatakshiiii marked this pull request as ready for review May 7, 2025 12:37
@shatakshiiii shatakshiiii requested a review from a team as a code owner May 7, 2025 12:37
@shatakshiiii shatakshiiii requested review from ssbarnea and cidrblock May 7, 2025 12:37
cidrblock
cidrblock previously approved these changes May 7, 2025
@shatakshiiii shatakshiiii marked this pull request as draft May 7, 2025 13:00
@shatakshiiii
Copy link
Contributor Author

shatakshiiii commented May 7, 2025

1st change -

  entry_value = entry.value.current.replace("$PWD", str(Path.cwd()))
  normalized = Path(entry_value).resolve(strict=strict_resolve).as_posix()

Even though the above change solves one problem i.e. running ansible-navigator commands. It stills crashes while I debug the code locally. So reverting this change as I need to check if there is a need of strict_resolve at line https://github.com/ansible/ansible-navigator/blob/main/src/ansible_navigator/configuration_subsystem/navigator_post_processor.py#L650

@shatakshiiii shatakshiiii changed the title Fix path expansion issue Improve path normalization with a fallback for non-existent paths May 8, 2025
@shatakshiiii shatakshiiii marked this pull request as ready for review May 12, 2025 07:26
@ssbarnea ssbarnea added this pull request to the merge queue May 12, 2025
@shatakshiiii shatakshiiii removed this pull request from the merge queue due to a manual request May 12, 2025
@shatakshiiii shatakshiiii merged commit 7ca02a0 into main May 12, 2025
20 checks passed
@shatakshiiii shatakshiiii deleted the path-expansion-bug branch May 12, 2025 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Researched, reproducible, committed to fix
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants