Skip to content

Commit

Permalink
rbd: priority to utilize 'at::PATH' rather than 'positional_path'
Browse files Browse the repository at this point in the history
`rbd import` will return failed if only "--path" is specified
without "--dest-pool" and "--dest".

Signed-off-by: songweibin <song.weibin@zte.com.cn>
  • Loading branch information
Songweibin committed Dec 30, 2017
1 parent 2113ebe commit 98dd5e5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/tools/rbd/Utils.cc
Expand Up @@ -806,10 +806,10 @@ int get_image_size(const boost::program_options::variables_map &vm,

int get_path(const boost::program_options::variables_map &vm,
const std::string &positional_path, std::string *path) {
if (!positional_path.empty()) {
*path = positional_path;
} else if (vm.count(at::PATH)) {
if (vm.count(at::PATH)) {
*path = vm[at::PATH].as<std::string>();
} else if (!positional_path.empty()) {
*path = positional_path;
}

if (path->empty()) {
Expand Down

0 comments on commit 98dd5e5

Please sign in to comment.