Skip to content

Commit

Permalink
Merge pull request #7102 from dzafman/wip-cot-fixes
Browse files Browse the repository at this point in the history
Fix for make check.

Reviewed-by: Sage Weil <sage@redhat.com>
  • Loading branch information
dzafman committed Jan 7, 2016
2 parents 12e3b3b + ad44bb5 commit 4e3bd8b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
9 changes: 3 additions & 6 deletions src/test/ceph_objectstore_tool.py
Expand Up @@ -887,17 +887,14 @@ def main(argv):
ERRORS += test_failure(cmd, "stdin is a tty and no --file filename specified", tty=True)

# Specify a bad --type
cmd = (CFSD_PREFIX + "--type foobar --op list --pgid {pg}").format(osd=ONEOSD, pg=ONEPG)
ERRORS += test_failure(cmd, "Must provide --type (filestore, memstore, keyvaluestore)")
os.mkdir(OSDDIR + "/fakeosd")
cmd = ("./ceph-objectstore-tool --data-path " + OSDDIR + "/{osd} --type foobar --op list --pgid {pg}").format(osd="fakeosd", pg=ONEPG)
ERRORS += test_failure(cmd, "Need a valid --type e.g. filestore, memstore, keyvaluestore")

# Don't specify a data-path
cmd = "./ceph-objectstore-tool --journal-path {dir}/{osd}.journal --type memstore --op list --pgid {pg}".format(dir=OSDDIR, osd=ONEOSD, pg=ONEPG)
ERRORS += test_failure(cmd, "Must provide --data-path")

# Don't specify a journal-path for filestore
cmd = "./ceph-objectstore-tool --type filestore --data-path {dir}/{osd} --op list --pgid {pg}".format(dir=OSDDIR, osd=ONEOSD, pg=ONEPG)
ERRORS += test_failure(cmd, "Must provide --journal-path")

cmd = (CFSD_PREFIX + "--op remove").format(osd=ONEOSD)
ERRORS += test_failure(cmd, "Must provide pgid")

Expand Down
8 changes: 6 additions & 2 deletions src/tools/ceph_objectstore_tool.cc
Expand Up @@ -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);
Expand Down Expand Up @@ -2462,7 +2466,7 @@ int main(int argc, char **argv)

ObjectStore *fs = ObjectStore::create(g_ceph_context, type, dpath, jpath, flags);
if (fs == NULL) {
cerr << "Must provide --type (filestore, memstore, keyvaluestore)" << std::endl;
cerr << "Need a valid --type e.g. filestore, memstore, keyvaluestore" << std::endl;
if (type == "keyvaluestore") {
cerr << "Add \"keyvaluestore\" to "
<< "enable_experimental_unrecoverable_data_corrupting_features"
Expand Down

0 comments on commit 4e3bd8b

Please sign in to comment.