Move SNAZZER_SUBVOLS_EXCLUDE_FILE init code to function#50
Conversation
Checking for the existance of /etc/snazzer/exclude.patterns is achieved through the use of sudo when snazzer is run as an unprivileged user. By moving the argument detection to top of script we can avoid situations where root privileges were required for commands that don't need elevated privileges (such as --help). Resolves: csirac2#24
|
Thanks for taking a look at this. :)
What I can think of:
In case we want to keep the option to make the exclude file only readable for root (@csirac2 ?), I think yours is a simple and working solution for this. |
|
Ideally I'd love to have function defs at the top, and entry points/actual code at the bottom - pascal warped my brain forever. It seems we've got things all over the place now :D The One day we should wrap up the But for now @jamiereid do you have time to change your PR to just drop |
This allows the code to only be called when needed, instead of every time snazzer is run. Also remove `$SUDO` from the `test -e`. This solution replaces the one in commit b57fa2b after discussions with @csirac2 and @florianjacob Resolves: csirac2#24
Checking for the existance of /etc/snazzer/exclude.patterns is achieved
through the use of sudo when snazzer is run as an unprivileged user.
By moving the argument detection to top of script we can avoid situations
where root privileges were required for commands that don't need elevated
privileges (such as --help).
Resolves: #24