Using a stringstream that is only displayed on error when calling the
erasure code factory, instead of cerr. The user expects the output to be
clean when there is no error.
http://tracker.ceph.com/issues/9429 Fixes: #9429
Signed-off-by: Loic Dachary <loic-201408@dachary.org>
{
ErasureCodePluginRegistry &instance = ErasureCodePluginRegistry::instance();
ErasureCodeInterfaceRef erasure_code;
- int code = instance.factory(plugin, parameters, &erasure_code, cerr);
- if (code)
+ stringstream messages;
+ int code = instance.factory(plugin, parameters, &erasure_code, messages);
+ if (code) {
+ cerr << messages.str() << endl;
return code;
+ }
int k = atoi(parameters["k"].c_str());
int m = atoi(parameters["m"].c_str());