removed output checks from data model and from implementation.

prepared to implement STD{IN,OUT,ERR} piping for subprocess execution.  Hoping to maintain compatibility with curses dialogs.
This commit is contained in:
Phanes
2017-12-01 01:13:30 -05:00
parent 3bc8908d65
commit 8545264a92
5 changed files with 32 additions and 46 deletions

View File

@@ -97,15 +97,22 @@ void Task::execute( bool verbose )
std::cout << "\t Executing target \"" << this->definition.get_target() << "\"." << std::endl;
}
ExecutionInput execIn;
Execution Result;
std::string executionString = this->definition.get_target();
std::string rectifierString = this->definition.get_rectifier();
execIn.executionString = this->definition.get_target();
int return_code = Sproc::execute( executionString );
int execution_status = Sproc::execute( execIn, Result );
if ( execution_status )
if ( return_code )
{
std::cout << std::endl << "STDOUT:" << std::endl<< Result.STDOUT << std::endl;
std::cout << "Process failed with exit code " << return_code << "." << std::endl;
std::cout << "Performing rectification: " << rectifierString << "." << std::endl;
int rectifier_error = Sproc::execute( rectifierString );
if ( rectifier_error )
{
std::cout << "Designated rectification script failed with error " << rectifier_error << "." << std::endl;
}
}
}

View File

@@ -48,9 +48,6 @@ int Unit::load_root(Json::Value loader_root)
if ( loader_root.isMember("target") )
{ this->target = loader_root.get("target", errmsg).asString(); } else throw Unit_DataStructureException();
if ( loader_root.isMember("output") )
{ this->output = loader_root.get("output", errmsg).asString(); } else throw Unit_DataStructureException();
if ( loader_root.isMember("rectifier") )
{ this->rectifier = loader_root.get("rectifier", errmsg).asString(); } else throw Unit_DataStructureException();