From 5d6b25c3c9f39b96901028e42939b6032392572e Mon Sep 17 00:00:00 2001 From: Igor Fedotov Date: Mon, 29 Oct 2018 21:14:32 +0300 Subject: [PATCH] os/bluestore: omit redundant '/' in OSD path for ceph-bluestore-tool if needed. Signed-off-by: Igor Fedotov --- src/os/bluestore/bluestore_tool.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/os/bluestore/bluestore_tool.cc b/src/os/bluestore/bluestore_tool.cc index 6268a0822eb..14b4a3624c0 100644 --- a/src/os/bluestore/bluestore_tool.cc +++ b/src/os/bluestore/bluestore_tool.cc @@ -262,7 +262,10 @@ int main(int argc, char **argv) std::cerr << e.what() << std::endl; exit(EXIT_FAILURE); } - + // normalize path (remove ending '/' if any) + if (path.size() > 1 && *(path.end() - 1) == '/') { + path.resize(path.size() - 1); + } if (vm.count("help")) { usage(po_all); exit(EXIT_SUCCESS); -- 2.39.5