Rework script#11
Conversation
|
(I also have a few other additions like |
|
@l0b0 thanks for the PR! Would you mind rebasing? |
|
No worries, here you go. |
|
Oh, I realize this doesn't gel with the possibility to run in |
|
& done. |
bed8399 to
22f6155
Compare
shymega
left a comment
There was a problem hiding this comment.
LGTM, no concerns from my end as a previous contributor to nm2nix.
|
Actually, there are several nitpicks. Output-wise, each attrset's key in the list is the full path. This is confusing and should be the filename of the connection, minus Logging should be silent by default, I think it's a bit noisy. I think by default as well, it should prioritize the CWD. If the CWD isn't Just my thoughts.. |
shymega
left a comment
There was a problem hiding this comment.
Output-wise, each attrset's key in the list is the full path. This is confusing and should be the filename of the connection, minus .nmconnection.
Logging should be silent by default, I think it's a bit noisy.
I think by default as well, it should prioritize the CWD. If the CWD isn't /etc/NetworkManager//var/run/NetworkManager, then run in two main NetworkManager state directories, if it is one of those directories, then it should scan that directory only.
- Use logger module for debugging purposes. - Read files from standard `/etc/NetworkManager/system-connections` directory rather than current directory, for ease of use. - Use temporary file context manager to delete after use.
And support setting the log level via the `LOGLEVEL` variable.
Good idea, done.
Agreed, done.
I've skipped this one, as I think it's too much surprising behaviour. If anything, I'd expect this to take an arbitrary number of arguments listing the directories it should traverse. |
I couldn't see the changes in-tree - have you pushed them?
Perhaps, yes. I think it should take an arbitrary number of directories though, rather than running in CWD. It feels like running in CWD could lead to exploits with specially crafted files (unlikely), or just plain up PEBKAC. Maybe use |
|
@Janik-Haag Could you approve CI on this? |
Whoops, pushed to the wrong remote. Fixed.
I feel like this is going well beyond the scope of this branch. Feel free to add more commits, but I don't know how much more time I have to spend on this. |
Well, the current branch now reads from a directory by default. I think this behaviour would be best left unchanged, as that's how it's been running for most people, and changing this behaviour would lead to confusion. |
/etc/NetworkManager/system-connectionsdirectory rather than current directory, for ease of use.