3 ms·
I have a couple of comments and a question: * please "set -e" and ideally "-euo pipefail" in shell scripts, because encountering an error and defaulting to "th
by mdaniel 5y ago
I have a couple of comments and a question:
* please "set -e" and ideally "-euo pipefail" in shell scripts, because encountering an error and defaulting to "this is fine" is usually not going to produce good outcomes in a server automation suite: https://github.com/mattbillenstein/salty/blob/master/example/apply#L2 https://github.com/mattbillenstein/salty/blob/master/example...
* if this had an "else: return 1" equivalent, it wouldn't cause the salty.py to exit(0) on a misunderstood mode: https://github.com/mattbillenstein/salty/blob/master/salty.py#L372 https://github.com/mattbillenstein/salty/blob/master/salty.p...
* maybe this is my ignorance of saltstack, but is there no mechanism through which a sane python editor could help one know what verbs and params are available here? https://github.com/mattbillenstein/salty/blob/master/example/roles/role1.py#L2 https://github.com/mattbillenstein/salty/blob/master/example...
For example, if those were "from salty import copy" a sane python editor could help in all kinds of ways, but with them just being implicit, the editor doesn't know and now I have to maintain a whole api in my head
- mattbillenstein 5y agoGood stuff. Yeah, I usually 'set -eo pipefail' as a habit In saltstack there are a bunch of docs, so you sorta have to find the correct state, look up params and whatnot - I think it may be worthwhile separating those things into another file just so folks can easily know what is available. Noted re arg handling - should probably use argparse - I've only spent an afternoon on it, so if it becomes a real tool, I'll end up doing that.