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
ceph.in: Fix couple of minor issues on the messages #12797
Conversation
retest this please |
c7b8050
to
99875bf
Compare
looks like some testcase failed due to the change, will look into it. |
@@ -732,10 +731,10 @@ def main(): | |||
print('Cluster connection aborted', file=sys.stderr) | |||
return 1 | |||
except rados.PermissionDeniedError as e: | |||
print('Error connecting to cluster: {0}'.format(e.__class__.__name__), file=sys.stderr) | |||
print(str(e), file=sys.stderr) |
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.
you removed the "Error connecting to cluster: " from the error message. is this intentional?
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.
@tchaikov thanks for the comments! yep it's intentional. instance "e" has already has the error message, the message is assembled here.
https://github.com/ceph/ceph/blob/master/src/pybind/rados/rados.pyx#L408-L422
The original code will say:
- Error connecting to cluster: Error (Error is the name of class given by e.class.name)
- If we dont remove "Error connecting to cluster: ", it will say as this:
Error connecting to cluster: error connecting to cluster: error code xx
As you can see, it's quite redundant, all error message has been included in the instance of "e", we can just pull the message out.
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, got it. so it will put
Error connecting to cluster: error connecting to the cluster: error code $error_code
without this change
return errno.EACCES | ||
except Exception as e: | ||
print('Error connecting to cluster: {0}'.format(e.__class__.__name__), file=sys.stderr) | ||
print(str(e), file=sys.stderr) |
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.
ditto.
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.
same here.
src/ceph.in
Outdated
@@ -715,7 +714,7 @@ def main(): | |||
timeout = 5 | |||
|
|||
hdr('Monitor commands:') | |||
print('[Contacting monitor, timeout after %d seconds]' % timeout) | |||
print('[Contacting monitor, timeout after %d seconds]' % timeout, file=sys.stderr) |
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.
why would we print this info to stderr? it's but informational string, not error message.
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.
I just want it consistent with others, but I agree with you there is no need to print it out to stderr, will address it shortly.
also you might want to change the prefix of "script: " to "ceph.in: ". as "script" is too general in this context. |
99875bf
to
1635c4c
Compare
retest this please (jenkins log gone) |
@tchaikov , thanks for visiting it again, looks like it failed some testcases, just cannot figure out the reason, will look into this again, thanks! |
- e.__class__.name is the name of class, use the error message assembled by function: make_ex instead. - repr(e) will also print the name of class, end user needn't care about the class name but the useful error message. - General clean up. Signed-off-by: Dave Chen <wei.d.chen@intel.com>
https://jenkins.ceph.com/job/ceph-pull-requests/18109/consoleFull @chendave you chmod'ed
|
@chendave, hey. better address this also. "git amend" will do the trick. |
1635c4c
to
b2b3a3f
Compare
@tchaikov many thanks for your help! |
by function: make_ex instead.
the class name but the useful error message.
Signed-off-by: Dave Chen wei.d.chen@intel.com