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 <lpetrut@cloudbasesolutions.com>
if (vm.count(at::IMAGE_NAME)) {
deprecated_image_name = vm[at::IMAGE_NAME].as<std::string>();
} 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;