Some helper functions clobber the passed in arg vector. This
causes operations on all but the first rank to fail as the
operations for the first rank tampers with the arg vector.
Signed-off-by: Venky Shankar <vshankar@redhat.com>
(cherry picked from commit
d5e482a6c2782993e6e9903eb6f11f5ebe260925)
// =========
for (auto role : role_selector.get_roles()) {
rank = role.rank;
+ std::vector<const char *> rank_argv(argv);
dout(4) << "Executing for rank " << rank << dendl;
if (mode == std::string("journal")) {
- r = main_journal(argv);
+ r = main_journal(rank_argv);
} else if (mode == std::string("header")) {
- r = main_header(argv);
+ r = main_header(rank_argv);
} else if (mode == std::string("event")) {
- r = main_event(argv);
+ r = main_event(rank_argv);
} else {
derr << "Bad command '" << mode << "'" << dendl;
usage();