New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pybind/mgr: generalize CLICheckNonemptyFileInput() error msg #41378
Conversation
a9d2f2a
to
cbd344d
Compare
Fixed mypy errors
|
Fixed flake8 error
|
@ceph/dashboard please run this through your QA when you can. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM @varshar16 ! Just left a few suggestions over there.
src/pybind/mgr/mgr_module.py
Outdated
ERROR_MSG_EMPTY_INPUT_FILE = 'File is empty!!' | ||
ERROR_MSG_NO_INPUT_FILE = 'No Input File!!' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit, but 2 exclamation marks might sound a bit... over-emphatic :P
I just grepped our source code (grep "[\"'][^\"']*\![^\"'][\"']" * -Ri --include="*.[py, h*,c*]"
) and found that it's not frequent in Ceph code (only in some deps, like zstd or civetweb).
What about using the POSIX errno style:
Empty input file: {details}
Input file not specified: {details}
This is probably more of a discussion for docs experts: @knortema ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting stack overflow discussion. I have updated the message.
src/pybind/mgr/mgr_module.py
Outdated
return -errno.EINVAL, '', f'{ERROR_MSG_NO_INPUT_FILE} Please specify the file '\ | ||
f'containing {content} with "-i" option' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about using HandleCommandResult()
helper instead of the raw tuple (retval, stdout, stderr)?
return -errno.EINVAL, '', f'{ERROR_MSG_NO_INPUT_FILE} Please specify the file '\ | |
f'containing {content} with "-i" option' | |
return HandleCommandResult( | |
-errno.EINVAL, | |
'', | |
f'{ERROR_MSG_NO_INPUT_FILE} Please specify the file '\ | |
f'containing {content} with "-i" option' | |
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reverted this change. As it requires multiple files to be updated. It is best to be done in a different PR.
a872cce
to
c805146
Compare
@epuertat Thanks for the review. I have updated the PR, please take another look. |
c805146
to
c132a96
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for addressing my comments. Looks good, @varshar16!! (worthy to add some exclamation marks :-P)
jenkins test dashboard |
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
Signed-off-by: Varsha Rao <varao@redhat.com>
Signed-off-by: Varsha Rao <varao@redhat.com>
Fixes: https://tracker.ceph.com/issues/50858 Signed-off-by: Varsha Rao <varao@redhat.com>
Signed-off-by: Varsha Rao <varao@redhat.com>
c132a96
to
a026ef2
Compare
Rebased |
jenkins test make check |
This PR makes the following changes:
Fixes: https://tracker.ceph.com/issues/50858
Show available Jenkins commands
jenkins retest this please
jenkins test classic perf
jenkins test crimson perf
jenkins test signed
jenkins test make check
jenkins test make check arm64
jenkins test submodules
jenkins test dashboard
jenkins test api
jenkins test docs
jenkins render docs
jenkins test ceph-volume all
jenkins test ceph-volume tox