clustershell icon indicating copy to clipboard operation
clustershell copied to clipboard

Type in the exact number of machines to proceed?

Open alexbozhenko opened this issue 4 years ago • 5 comments

Hi.

I found idea in this blog post may be useful in clush: https://rachelbythebay.com/w/2020/10/26/num/

Would you be open to a pull request that adds a configurable confirmation like described in the post?

alexbozhenko avatar Nov 23 '20 22:11 alexbozhenko

@thiell what do you think?

alexbozhenko avatar Nov 30 '20 23:11 alexbozhenko

@alexbozhenko apologies for the delay. I would say, if you have the code ready, please submit the PR so we can have a look. If the patch is too big, we probably won't include it though, as we try to keep things as simple as possible, but in any case, it could be of interest to others. Thx!

thiell avatar Dec 01 '20 00:12 thiell

For what is worth we've done it in Cumin (that uses ClusterShell underneath for the transport) and opted to avoid the thousands separator bit as it felt a bit too much. I think it would be a nice to have addition.

volans- avatar Dec 01 '20 09:12 volans-

Additionally to what Stéphane said. I think you should be able to have a small patch for that, I would recommend:

  • Use a configuration option to enable this behavior. Should that be a node count limit? If the number of target is greater than this value, trigger the confirmation. Keeping this value unset disable the check. ClusterShell has code that helps creating config option that could be also use on command line easily.
  • Implement this in Clush code, after nodeset_base has been fully computed. That should be enough to do what you want. That should be completed with:
  • Doc update for the new config options
  • Tests

degremont avatar Dec 01 '20 09:12 degremont

For what is worth we've done it in Cumin (that uses ClusterShell underneath for the transport) and opted to avoid the thousands separator bit as it felt a bit too much. I think it would be a nice to have addition.

Oh, I see. https://github.com/wikimedia/cumin/commit/5c18e5c17cd3dd6a19b6a6a39764ca4d5e70f000 Thanks for the reference!

alexbozhenko avatar Dec 02 '20 18:12 alexbozhenko