Thanks for taking the time to do this, this looks like a good improvement.
Some tests for this would be good, to ensure that we don't regress here[0]. TestGenericDistro in tests/unittests/test_distros/test_generic.py already has the means to do filesystem mocking in place, so it shouldn't be too painful.
Dan
[0] If I weren't looking at the code too carefully, I'd replace what you've written with os.path.isdir; but that would be incorrect because it follows symbolic links. Having something that makes us notice if someone does this would be valuable.
Hi Lars,
Thanks for taking the time to do this, this looks like a good improvement.
Some tests for this would be good, to ensure that we don't regress here[0]. TestGenericDistro in tests/unittests /test_distros/ test_generic. py already has the means to do filesystem mocking in place, so it shouldn't be too painful.
Dan
[0] If I weren't looking at the code too carefully, I'd replace what you've written with os.path.isdir; but that would be incorrect because it follows symbolic links. Having something that makes us notice if someone does this would be valuable.