Fixed check_ceph_osd for Ceph Octopus.#83
Open
HeroesLament wants to merge 2 commits intoceph:masterfrom
Open
Conversation
Removed unnecessary parentheses for Python 3, fixed regex variable import, and added a loop to the print statements to properly format the aggregate OSD states. The findall regex function of python3 outputs a tuple when searching for multiple statements. This is in contrast to prior versions which output an array of strings, requiring us to loop through joining the tuples prior to printing.
Contributor
|
Hello @HeroesLament, |
valerytschopp
suggested changes
May 3, 2022
Contributor
valerytschopp
left a comment
There was a problem hiding this comment.
I can not merge you PR:
- Wrong python3 print statements
- Commands not executed
So please change your PR accordingly, and I will re-consider it
| # validate args | ||
| ceph_exec = args.exe if args.exe else CEPH_COMMAND | ||
| if not os.path.exists(ceph_exec): | ||
| print("OSD ERROR: ceph executable '%s' doesn't exist" % ceph_exec) |
Contributor
There was a problem hiding this comment.
Python3 print requires parentheses!
| print("OSD ERROR: %s" % err) | ||
| return STATUS_ERROR | ||
| # exec command | ||
| print ceph_cmd |
Contributor
There was a problem hiding this comment.
You just print the ceph_cmd?!? Where is it executed?
Author
|
Hello @valerytschopp , The work our team was doing on this was apparently not on track. The server this was being worked on was running python 2.7, so much of the syntax was not correct. We are working to re-factor this with python 3.8 now. |
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.
Removed unnecessary parentheses for Python 3, fixed regex variable import, and added a loop to the print statements to properly format the aggregate OSD states.
The findall regex function of python3 outputs a tuple when searching for multiple statements. This is in contrast to prior versions which output an array of strings, requiring us to loop through joining the tuples prior to printing.