upmap: Add basic/empty filter to jq and fix Python string/JSON issue#41
Open
Avatat wants to merge 1 commit intocernceph:masterfrom
Open
upmap: Add basic/empty filter to jq and fix Python string/JSON issue#41Avatat wants to merge 1 commit intocernceph:masterfrom
Avatat wants to merge 1 commit intocernceph:masterfrom
Conversation
9d5ec8d to
10257ce
Compare
Contributor
|
I was running into these jq issues as well, but instead of investigating what was wrong with the current implementation I converted this tool to use the python rados library. #42 |
davidturner-sie
added a commit
to drakonstein/ceph-scripts
that referenced
this pull request
Sep 4, 2024
Collaborator
|
Thanks I'll test these changes next week when back from Ceph Day Korea. |
Collaborator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hello everyone!
First and foremost, I would like to thank you for creating this script - it's incredibly helpful in my daily work!
A few months ago, I started having issues with the
upmap-remapped.pyscript (on Ubuntus 16.04 - 20.04, Cephs 14-16).I quickly discovered that the issue occurred due to the recently added
jqfiltering. According to thejqmanual, it requires a filter, and the basic/empty filter is just a dot.. The fix was trivial: adding a dot.filter to alljqcommands resolved the issue, and the script started working again.A few tries/weeks later, I encountered another issue - Python was complaining that the JSON string wasn't correct and couldn't be decoded. I was surprised because the string had gone through
jq, so it should have been correct. This issue occurred some time ago, so I can't provide all the details, but it was related to some special characters or sequence in the JSON string fromceph pg ls remappedthat was parsed by Python. I'm certain it was related to the issue described here: https://discuss.python.org/t/help-json-loads-cannot-parse-valid-json/12605But getting back to the point I fixed the Python string/JSON issue by converting the subprocess output to a "raw string" which was then correctly decoded by the JSON interpreter/decoder.