From: Lucian Petrut Date: Wed, 6 May 2020 10:59:39 +0000 (+0000) Subject: rbd: fix import image path parsing on Windows X-Git-Tag: v16.1.0~543^2~7 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=1dbe03a0734437022095a33062a05844e6201661;p=ceph.git rbd: fix import image path parsing on Windows When importing an image, the rbd command uses only the file name and expects "/" to be used as a separator. On Windows, it will use the entire path as image name since the path separator is not the same. This change updates it so that the "\\" path separator can be properly handled as well. Signed-off-by: Lucian Petrut --- diff --git a/src/tools/rbd/action/Import.cc b/src/tools/rbd/action/Import.cc index f8d2f936ffaf..0cdf3b713f8e 100644 --- a/src/tools/rbd/action/Import.cc +++ b/src/tools/rbd/action/Import.cc @@ -964,7 +964,7 @@ int execute(const po::variables_map &vm, if (vm.count(at::IMAGE_NAME)) { deprecated_image_name = vm[at::IMAGE_NAME].as(); } else { - deprecated_image_name = path.substr(path.find_last_of("/") + 1); + deprecated_image_name = path.substr(path.find_last_of("/\\") + 1); } std::string deprecated_snap_name;