Commit f067fea6 authored by Michael Davis's avatar Michael Davis
Browse files

[migration] Removes ping from EosImportDirs.cpp

ping is implemented in the test programs, so it's redundant to have it
in the directory injection program.
parent c8da2d76
......@@ -42,10 +42,6 @@ public:
void getTreeDepth();
bool processBatch();
std::string ping(const std::string &payload) {
return m_eosgrpc->ping(payload);
}
struct Dirname {
std::string basename; //!< Just the directory name
std::string pathname; //!< The full path including the directory name
......@@ -259,7 +255,7 @@ void throwUsage(const std::string &program, const std::string &error_txt)
std::stringstream help;
help << program << ": " << error_txt << std::endl
<< "Usage: " << program << " [--config <config_file>] [ping]";
<< "Usage: " << program << " [--config <config_file>]";
throw std::runtime_error(help.str());
}
......@@ -269,8 +265,6 @@ int main(int argc, const char* argv[])
{
std::string configfile = "/etc/cta/castor-migration.conf";
bool doPing = false;
try {
for(auto i = 1; i < argc; ++i) {
std::string option(argv[i]);
......@@ -278,23 +272,13 @@ int main(int argc, const char* argv[])
if(option == "--config" && argc > ++i) {
configfile = argv[i];
continue;
} else if(option == "ping") {
doPing = true;
continue;
}
throwUsage(argv[0], "invalid option " + option);
}
cta::migration::EosImportDirs importDirs(configfile);
if(doPing) {
std::cout << "Pinging EOS MGM using gRPC API..." << std::endl;
auto pingStr = importDirs.ping("Ping from EosImportDirs");
std::cout << "Ping successful. Server responded with: " << pingStr << std::endl;
} else {
importDirs.getStorageClasses();
importDirs.getTreeDepth();
while(importDirs.processBatch()) ;
}
importDirs.getStorageClasses();
importDirs.getTreeDepth();
while(importDirs.processBatch()) ;
} catch(std::runtime_error &ex) {
std::cerr << ex.what() << std::endl;
return -1;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment