mobie / mobie-utils-python

Python tools for MoBIE
MIT License
9 stars 5 forks source link

validation does not check for write access to folder #56

Closed martinschorb closed 2 years ago

martinschorb commented 2 years ago

Hi,

I am running into a (I admit, very unlikely) error using a CI run for tests:

https://github.com/mobie/mobie-utils-python/blob/8c51e92a79cff578f3fc75a11375092188cfee80/mobie/validation/utils.py#L20

wants to create ~/.mobie without checking for access to that path. In my scenario, I run the tests as a temporary unprivileged user whose home directory does not exist.

constantinpape commented 2 years ago

I see. The usual solution to this is to add an env variable MOBIE_FOLDER or so which defaults to ~/.mobie, but which you can over-write. Would this solve your problem? It's easy for me to implement.

martinschorb commented 2 years ago

I adjusted my CI workflow to provide the home directory. I just wasn't sure what would be a clean way of avoiding to run into this.

constantinpape commented 2 years ago

Ok, I assume that this is a corner case and solved for you. For the most part I would think that access to the home dir is ok. If it becomes an issue again feel free to re-open.