Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Return absolute path without resolving symlinks
After the rewrite of util.abs_path to use pathlib instead of os.path the function now resolves symlinks in the given path whereas it did not do before. This breaks setups where the molecule.yml file in a scenario is a symlink. Unfortunately pathlib is not a drop-in replacement for os.path (see https://docs.python.org/3/library/pathlib.html#comparison-to-the-os-and-os-path-modules) Path.absolute does not resolve symlink but does not reduce /../ segments in the path. Path.resolve does reduce /../ path elements, but also resolves symlinks. There is no method or combination of methods in the Path object that can deliver the same functionality as os.path.abspath. Hence the code reverts back to using os.path.abspath, but keeps accepting Path objects as input and returns the absolute path as such in these cases. Signed-off-by: Ruediger Pluem <[email protected]>
- Loading branch information