From 1dbe03a0734437022095a33062a05844e6201661 Mon Sep 17 00:00:00 2001 From: Lucian Petrut Date: Wed, 6 May 2020 10:59:39 +0000 Subject: [PATCH] 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 --- src/tools/rbd/action/Import.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/rbd/action/Import.cc b/src/tools/rbd/action/Import.cc index f8d2f936ffafd..0cdf3b713f8e0 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; -- 2.39.5