Skip to content

Commit

Permalink
tools/rados: Check return value of connect
Browse files Browse the repository at this point in the history
Fail gracefully if Rados::connect returns an error.

Fixes: http://tracker.ceph.com/issues/19319
Signed-off-by: Brad Hubbard <bhubbard@redhat.com>
  • Loading branch information
badone committed Mar 21, 2017
1 parent fe66443 commit c119091
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/tools/rados/RadosImport.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@ int RadosImport::import(std::string pool, bool no_overwrite)
cerr << "Error " << ret << " in cluster.conf_read_env" << std::endl;
return ret;
}
cluster.connect();
ret = cluster.connect();
if (ret) {
cerr << "Error " << ret << " in cluster.connect" << std::endl;
return ret;
}

ret = cluster.ioctx_create(pool.c_str(), ioctx);
if (ret < 0) {
Expand Down

0 comments on commit c119091

Please sign in to comment.