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
make rados get/put/append command help txt clear #20363
Conversation
src/tools/rados/rados.cc
Outdated
usage_exit(); | ||
ret = do_put(io_ctx, striper, nargs[1], nargs[2], op_size, obj_offset, use_striper); | ||
if (nargs.size() == 2) { | ||
ret = do_put(io_ctx, striper, nargs[1], nargs[1], op_size, obj_offset, use_striper); |
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.
If a file with the name of the object already exists in the current directory, this will overwrite it?
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.
yes, if run "rados get" without outfile, the same name object in the current directory will be overwrited.
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.
That doesn't seem right to me.
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.
But,that is just similar with the situation that you specifty outfile with a existed name, isn't it?
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.
The difference is that in one case I am specifying a filename explicitly, and in the other case not.
It makes me uncomfortable to have the utility silently overwrite files that the user did not specify explicitly.
For example, mv SOURCE DEST
will overwrite DEST because you specified it explicitly. But if you specify only mv SOURCE
, an error "missing destination file operand" will be displayed.
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.
well, user will more likely to realize the possible overwriting if he specify the outfile name, it is more serious style.
Hmm, maybe we want to make the help text clearer instead? You can get/put without a filename if you specify the stdin/stdout with "-i -" (or whatever it is), right? |
@gregsfortytwo |
updated~ |
Well if I look at https://github.com/ceph/ceph/blob/master/src/tools/rados/rados.cc#L291 it appears that both get and put allow you to pass "-" for the filename to use the STDIN/STDOUT pipes. So I think that works; the filenames just aren't optional. My concern about just dumping it to a file named like the object is that object names might include special characters that do funny things like parse out as directory paths or break the shell, but I don't have real strong feelings as long as it's guarded properly... |
yep,I have updated it and now just adjust the help info, that seems to be rational~ @smithfarm @gregsfortytwo |
could you prefix the title of your commit message with the subcomponent your are changing ? see https://github.com/ceph/ceph/blob/master/SubmittingPatches.rst#3-describe-your-changes . in this case, it could be "rados" or "tools/rados". |
Fixes: http://tracker.ceph.com/issues/22958 Signed-off-by: lvshuhua <lvshuhua@cmss.chinamobile.com>
@tchaikov added it |
Fixes: http://tracker.ceph.com/issues/22958