]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-objectstore-tool: Warn if --type specified and doesn't match fs
authorDavid Zafman <dzafman@redhat.com>
Mon, 4 Jan 2016 19:01:20 +0000 (11:01 -0800)
committerDavid Zafman <dzafman@redhat.com>
Mon, 4 Jan 2016 19:01:20 +0000 (11:01 -0800)
Signed-off-by: David Zafman <dzafman@redhat.com>
src/tools/ceph_objectstore_tool.cc

index 1988c80b6b3544d7dae0d9c1a562d43f2708c8b9..7f39f92ca2efc397e643dbba962b489d0075a324 100644 (file)
@@ -2316,7 +2316,11 @@ int main(int argc, char **argv)
     bufferlist bl;
     bl.read_fd(fd, 64);
     if (bl.length()) {
-      type = string(bl.c_str(), bl.length() - 1);  // drop \n
+      string dp_type = string(bl.c_str(), bl.length() - 1);  // drop \n
+      if (vm.count("type") && dp_type != "" && type != dp_type)
+        cerr << "WARNING: Ignoring type \"" << type << "\" - found data-path type \""
+             << dp_type << "\"" << std::endl;
+      type = dp_type;
       //cout << "object store type is " << type << std::endl;
     }
     ::close(fd);