Skip to content
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

Merged
merged 1 commit into from Feb 12, 2018
Merged

make rados get/put/append command help txt clear #20363

merged 1 commit into from Feb 12, 2018

Conversation

dongbula
Copy link

@dongbula dongbula commented Feb 8, 2018

@smithfarm smithfarm added the tools label Feb 8, 2018
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);
Copy link
Contributor

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?

Copy link
Author

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.

Copy link
Contributor

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.

Copy link
Author

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?

Copy link
Contributor

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.

Copy link
Author

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.

@gregsfortytwo
Copy link
Member

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?

@dongbula
Copy link
Author

dongbula commented Feb 9, 2018

@gregsfortytwo
Hi, I notice that the "-i" option seems to not be implemented,and there is also no option for outfile ( "rados get”). Should we keep "-i" and make the infile to be a option that user must specifiy?

@dongbula
Copy link
Author

dongbula commented Feb 9, 2018

updated~

@gregsfortytwo
Copy link
Member

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...

@dongbula dongbula changed the title enable rados get/put command run without filename make rados get/put/append command help txt clear Feb 12, 2018
@dongbula
Copy link
Author

yep,I have updated it and now just adjust the help info, that seems to be rational~ @smithfarm @gregsfortytwo

@tchaikov
Copy link
Contributor

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>
@dongbula
Copy link
Author

@tchaikov added it

@gregsfortytwo gregsfortytwo merged commit 72ad764 into ceph:master Feb 12, 2018
@dongbula dongbula deleted the e-rados-get-put-command branch February 22, 2018 01:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants