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:
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user