~jk0/nova/improve-pylint-scores

« back to all changes in this revision

Viewing changes to nova/compute/manager.py

  • Committer: Tarmac
  • Author(s): Josh Kearney
  • Date: 2011-04-19 19:31:17 UTC
  • mfrom: (996.1.3 improve-pylint-scores)
  • Revision ID: tarmac-20110419193117-k9g6fzoat0f8n0sl
Round 1 of pylint cleanup.

Show diffs side-by-side

added added

removed removed

Lines of Context:
434
434
        """Destroys the source instance"""
435
435
        context = context.elevated()
436
436
        instance_ref = self.db.instance_get(context, instance_id)
437
 
        migration_ref = self.db.migration_get(context, migration_id)
438
437
        self.driver.destroy(instance_ref)
439
438
 
440
439
    @exception.wrap_exception
525
524
        self.db.migration_update(context, migration_id,
526
525
                {'status': 'post-migrating', })
527
526
 
528
 
        service = self.db.service_get_by_host_and_topic(context,
529
 
                migration_ref['dest_compute'], FLAGS.compute_topic)
 
527
        # Make sure the service exists before sending a message.
 
528
        _service = self.db.service_get_by_host_and_topic(context,
 
529
                 migration_ref['dest_compute'], FLAGS.compute_topic)
530
530
        topic = self.db.queue_get_for(context, FLAGS.compute_topic,
531
531
                migration_ref['dest_compute'])
532
532
        rpc.cast(context, topic,
652
652
 
653
653
        """
654
654
        context = context.elevated()
655
 
        instance_ref = self.db.instance_get(context, instance_id)
656
655
 
657
656
        LOG.debug(_('instance %s: locking'), instance_id, context=context)
658
657
        self.db.instance_update(context, instance_id, {'locked': True})
664
663
 
665
664
        """
666
665
        context = context.elevated()
667
 
        instance_ref = self.db.instance_get(context, instance_id)
668
666
 
669
667
        LOG.debug(_('instance %s: unlocking'), instance_id, context=context)
670
668
        self.db.instance_update(context, instance_id, {'locked': False})