]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
erasure-code: return error using `ss` not derr
authorKefu Chai <kchai@redhat.com>
Mon, 12 Nov 2018 03:04:54 +0000 (11:04 +0800)
committerKefu Chai <kchai@redhat.com>
Thu, 15 Nov 2018 06:34:03 +0000 (14:34 +0800)
log is not very visible from user's perspective. we'd better return the
error message using the input parameter, if the technique is
unsupported.

also, remove the trailing newline, as `ss` will be sent back to user,
it's the the front-end's responsibility to format the error message.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/erasure-code/jerasure/ErasureCodePluginJerasure.cc

index 966c765565d9771ea18d28f41230b27ed40b1f96..353b71b804edda9547f3b8d4bd108e887915b007 100644 (file)
@@ -54,11 +54,10 @@ int ErasureCodePluginJerasure::factory(const std::string& directory,
     } else if (t == "liber8tion") {
       interface = new ErasureCodeJerasureLiber8tion();
     } else {
-      derr << "technique=" << t << " is not a valid coding technique. "
+      *ss << "technique=" << t << " is not a valid coding technique. "
           << " Choose one of the following: "
           << "reed_sol_van, reed_sol_r6_op, cauchy_orig, "
-          << "cauchy_good, liberation, blaum_roth, liber8tion"
-          << dendl;
+          << "cauchy_good, liberation, blaum_roth, liber8tion";
       return -ENOENT;
     }
     dout(20) << __func__ << ": " << profile << dendl;