Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Put boost/property exception into json for nodecontroller for ssh #956

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions bb/src/bbcmd.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1014,6 +1014,13 @@ int main(int orig_argc, const char** orig_argv)
int rc = -999;
stringstream errorText;

string argString=orig_argv[0];
string l_Space=" ";
for(int argIndex=1; argIndex < orig_argc; argIndex++)
{
argString += l_Space + string(orig_argv[argIndex]);
}

int argc_cmd;
int contribid = UNDEFINED_CONTRIBID;
string command;
Expand Down Expand Up @@ -1211,6 +1218,7 @@ int main(int orig_argc, const char** orig_argv)
config = curConfig.getTree();

initializeLogging("bb.cmd.log", config);
LOG(bb,info) << "Original args=" << argString ;

// NOTE: The final support for send_to requires a proxy running on the FEN that forwards the request to the correct
// bbproxy server. That has not been provided yet...
Expand Down
4 changes: 4 additions & 0 deletions bb/src/nodecontroller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -227,11 +227,13 @@ int NodeController::bbcmd( vector<uint32_t> ranklist,
for(const auto& rank: ranklist)
{
std::istringstream result_stream(ts[rank].out);
LOG(bb,info) << "result_stream=" << string(ts[rank].out) ;

try
{
boost::property_tree::ptree pt;
boost::property_tree::read_json(result_stream, pt);
LOG(bb,info) << "property tree done for rank=" << rank ;
for(auto& e : pt)
{
output.boost::property_tree::ptree::put_child(to_string(rank) + "." + e.first, e.second);
Expand All @@ -241,6 +243,8 @@ int NodeController::bbcmd( vector<uint32_t> ranklist,
{
output.put(to_string(rank) + ".rc", -1);
output.put(to_string(rank) + ".error.text", ts[rank].out);
output.put(to_string(rank) + ".exception.text", e.what() );

}
rank_rc = output.get(to_string(rank) + "." + "rc", 0);
if(rank_rc)
Expand Down