mirror of
https://github.com/ceph/ceph
synced 2025-02-24 03:27:10 +00:00
tools/ceph-dencoder: print human-readable error message
if $CEPH_LIB is not specified. Signed-off-by: Kefu Chai <kchai@redhat.com>
This commit is contained in:
parent
2365f265b1
commit
195d1e8c8e
@ -23,6 +23,7 @@ namespace fs = std::filesystem;
|
||||
#include <experimental/filesystem>
|
||||
namespace fs = std::experimental::filesystem;
|
||||
#endif
|
||||
#include <iomanip>
|
||||
|
||||
#include "ceph_ver.h"
|
||||
#include "include/types.h"
|
||||
@ -105,6 +106,12 @@ vector<DencoderPlugin> load_plugins()
|
||||
if (auto ceph_lib = getenv("CEPH_LIB"); ceph_lib) {
|
||||
mod_dir = ceph_lib;
|
||||
}
|
||||
if (!fs::is_directory(mod_dir)) {
|
||||
std::cerr << "unable to load dencoders from "
|
||||
<< std::quoted(mod_dir.native()) << ". "
|
||||
<< "it is not a directory." << std::endl;
|
||||
return {};
|
||||
}
|
||||
vector<DencoderPlugin> dencoder_plugins;
|
||||
for (auto& entry : fs::directory_iterator(mod_dir)) {
|
||||
static const string_view DENC_MOD_PREFIX = "denc-mod-";
|
||||
|
Loading…
Reference in New Issue
Block a user