You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unandled exception if ksconf sort -i runs against a file that can't be updated.
Environment
Ksconf version: 0.7.2
OS & version used: Amazon Linux
Python version: 2.7
Installed via: pip via pre-commit
Details
$ ksconf --version
_ __
| | / _|
| | _____ ___ ___ _ __ | |_
| |/ / __|/ __/ _ \| '_ \| _|
| <\__ \ (_| (_) | | | | |
|_|\_\___/\___\___/|_| |_|_|
ksconf 0.7.2 (Build 341)
Python: 2.7.14 (/usr/bin/python2)
Git SHA1 c1923770 committed on 2019-03-22
Installed at: /usr/lib/python2.7/site-packages/ksconf
Written by Lowell Alleman <lowell@kintyre.co>.
Copyright (c) 2019 Kintyre Solutions, Inc, all rights reserved.
Licensed under Apache Public License v2
kintyre_splunk_conf (0.7.2)
Commands:
check (stable) OK
combine (beta) OK
diff (stable) OK
filter (alpha) OK
merge (stable) OK
minimize (beta) OK
promote (beta) OK
rest-export (beta) OK
rest-publish (alpha) OK
snapshot (alpha) OK
sort (stable) OK
unarchive (beta) OK
Example Traceback:
Traceback (most recent call last):
File "/opt/splunk/.cache/pre-commit/repo35FeDP/py_env-python2/bin/end-of-file-fixer", line 10, in <module>
sys.exit(end_of_file_fixer())
File "/opt/splunk/.cache/pre-commit/repo35FeDP/py_env-python2/lib/python2.7/site-packages/pre_commit_hooks/end_of_file_fixer.py", line 58, in end_of_file_fixer
with open(filename, 'rb+') as file_obj:
IOError: [Errno 13] Permission denied: 'MYORG_props/default/app.conf'
Steps To Reproduce Issue
Make file read-only
Run ksconf sort -i on it.
The text was updated successfully, but these errors were encountered:
IOError should be trapped and not handled as an unhandled exception. The error should be written to stderr; and if multiple inputs files were given, it should continue with the others.
This error should be classified as an "Error" and reported as such in the output summary screen. (In other words, it should be listed alongside of files that were modified or unchanged.)
We must ensure that exit code is non-0 when an errors occurs. (Create a new exit code, if none of them currently fit). This is critical for pre-commit and other scripting uses of ksconf.
The problem
Unandled exception if
ksconf sort -i
runs against a file that can't be updated.Environment
Details
Example Traceback:
Steps To Reproduce Issue
ksconf sort -i
on it.The text was updated successfully, but these errors were encountered: