summaryrefslogtreecommitdiffstats
path: root/src/tools/ceph_kvstore_tool.cc
diff options
context:
space:
mode:
authorSage Weil <sage@redhat.com>2017-04-21 00:08:49 +0200
committerSage Weil <sage@redhat.com>2017-04-24 16:04:00 +0200
commitb05b018f6c21cc465e29b3b1dc74d2f4540f20a1 (patch)
treeebaaaeef2f42faba6049578a41ef0d46b66fcad1 /src/tools/ceph_kvstore_tool.cc
parentceph-kvstore-tool: 'bluestore-kv' to open bluestore's embedded kv (diff)
downloadceph-b05b018f6c21cc465e29b3b1dc74d2f4540f20a1.tar.xz
ceph-b05b018f6c21cc465e29b3b1dc74d2f4540f20a1.zip
ceph-kvstore-tool: nicer failure message on open failure
I have been hating this assert for a long time. Signed-off-by: Sage Weil <sage@redhat.com>
Diffstat (limited to '')
-rw-r--r--src/tools/ceph_kvstore_tool.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/tools/ceph_kvstore_tool.cc b/src/tools/ceph_kvstore_tool.cc
index e0efe39e7d4..0c96a041665 100644
--- a/src/tools/ceph_kvstore_tool.cc
+++ b/src/tools/ceph_kvstore_tool.cc
@@ -37,7 +37,12 @@ class StoreTool
public:
StoreTool(string type, const string &path) : store_path(path) {
KeyValueDB *db_ptr = KeyValueDB::create(g_ceph_context, type, path);
- assert(!db_ptr->open(std::cerr));
+ int r = db_ptr->open(std::cerr);
+ if (r < 0) {
+ cerr << "failed to open type " << type << " path " << path << ": "
+ << cpp_strerror(r) << std::endl;
+ exit(1);
+ }
db.reset(db_ptr);
}