Revision 6a373640 lib/mcpu.py

b/lib/mcpu.py
144 144

  
145 145
    """
146 146

  
147
  def SubmitManyJobs(self, jobs):
148
    """Submits jobs for processing.
149

  
150
    See L{jqueue.JobQueue.SubmitManyJobs}.
151

  
152
    """
153
    raise NotImplementedError
154

  
147 155

  
148 156
def _LUNameForOpName(opname):
149 157
  """Computes the LU name for a given OpCode name.
......
209 217

  
210 218
    return acquired
211 219

  
220
  def _ProcessResult(self, result):
221
    """
222

  
223
    """
224
    if isinstance(result, cmdlib.ResultWithJobs):
225
      # Submit jobs
226
      job_submission = self._cbs.SubmitManyJobs(result.jobs)
227

  
228
      # Build dictionary
229
      result = result.other
230

  
231
      assert constants.JOB_IDS_KEY not in result, \
232
        "Key '%s' found in additional return values" % constants.JOB_IDS_KEY
233

  
234
      result[constants.JOB_IDS_KEY] = job_submission
235

  
236
    return result
237

  
212 238
  def _ExecLU(self, lu):
213 239
    """Logical Unit execution sequence.
214 240

  
......
229 255
      return lu.dry_run_result
230 256

  
231 257
    try:
232
      result = lu.Exec(self.Log)
258
      result = self._ProcessResult(lu.Exec(self.Log))
233 259
      h_results = hm.RunPhase(constants.HOOKS_PHASE_POST)
234 260
      result = lu.HooksCallBack(constants.HOOKS_PHASE_POST, h_results,
235 261
                                self.Log, result)

Also available in: Unified diff