Exemplo n.º 1
0
 /**
  * will submit the passed in $dagScript to condor,
  * executing in the passed in $workDir.
  *
  * @param string $workDir
  * @param string $dagScript
  * @throws Zend_Exception
  */
 public function condorSubmitDag($workDir, $dagScript)
 {
     // Prepare command
     $params = array($dagScript);
     $cmd = KWUtils::prepareExecCommand($this->configCondorBinDir . '/' . MIDAS_BATCHMAKE_CONDOR_SUBMIT_DAG, $params);
     // Run command
     $this->executor->exec($cmd, $output, $workDir, $returnVal);
     if ($returnVal !== 0) {
         throw new Zend_Exception('condorSubmitDag: Failed to run: [' . $cmd . '], output: [' . implode(',', $output) . ']');
     }
 }
Exemplo n.º 2
0
 /** tests prepareExecCommand function */
 public function testPrepareExecCommand()
 {
     $app = 'php';
     if (KWUtils::isWindows()) {
         $app .= '.exe';
     }
     $returnVal = KWUtils::prepareExecCommand($app, array('blah1', 'blah2', 'blah3'));
     $appPath = KWUtils::findApp($app, true);
     $this->assertEquals($returnVal, "'" . $appPath . "' 'blah1' 'blah2' 'blah3'");
 }