~sandy-walsh/nova/zones2

« back to all changes in this revision

Viewing changes to nova/compute/manager.py

  • Committer: Sandy Walsh
  • Date: 2011-03-03 14:55:02 UTC
  • mfrom: (635.1.122 nova)
  • Revision ID: sandy.walsh@rackspace.com-20110303145502-ow2b0cgs00zlhtt7
trunk merge, pip-requires and novatools to novaclient changes

Show diffs side-by-side

added added

removed removed

Lines of Context:
370
370
        context = context.elevated()
371
371
        instance_ref = self.db.instance_get(context, instance_id)
372
372
        LOG.audit(_('instance %s: rescuing'), instance_id, context=context)
373
 
        self.db.instance_set_state(context,
374
 
                                   instance_id,
375
 
                                   power_state.NOSTATE,
376
 
                                   'rescuing')
 
373
        self.db.instance_set_state(
 
374
            context,
 
375
            instance_id,
 
376
            power_state.NOSTATE,
 
377
            'rescuing')
377
378
        self.network_manager.setup_compute_network(context, instance_id)
378
 
        self.driver.rescue(instance_ref)
 
379
        self.driver.rescue(
 
380
            instance_ref,
 
381
            lambda result: self._update_state_callback(
 
382
                self,
 
383
                context,
 
384
                instance_id,
 
385
                result))
379
386
        self._update_state(context, instance_id)
380
387
 
381
388
    @exception.wrap_exception
385
392
        context = context.elevated()
386
393
        instance_ref = self.db.instance_get(context, instance_id)
387
394
        LOG.audit(_('instance %s: unrescuing'), instance_id, context=context)
388
 
        self.db.instance_set_state(context,
389
 
                                   instance_id,
390
 
                                   power_state.NOSTATE,
391
 
                                   'unrescuing')
392
 
        self.driver.unrescue(instance_ref)
 
395
        self.db.instance_set_state(
 
396
            context,
 
397
            instance_id,
 
398
            power_state.NOSTATE,
 
399
            'unrescuing')
 
400
        self.driver.unrescue(
 
401
            instance_ref,
 
402
            lambda result: self._update_state_callback(
 
403
                self,
 
404
                context,
 
405
                instance_id,
 
406
                result))
393
407
        self._update_state(context, instance_id)
394
408
 
395
409
    @staticmethod