~nova-coresec/nova/bexar-translations

« back to all changes in this revision

Viewing changes to nova/compute/manager.py

  • Committer: Ed Leafe
  • Date: 2011-01-19 02:00:28 UTC
  • mto: This revision was merged to the branch mainline in revision 607.
  • Revision ID: ed@leafe.com-20110119020028-3hthda2qccp2uawa
Completed first pass at converting all localized strings with multiple format substitutions.

Show diffs side-by-side

added added

removed removed

Lines of Context:
77
77
 
78
78
        LOG.info(_("check_instance_lock: decorating: |%s|"), function,
79
79
                 context=context)
80
 
        LOG.info(_("check_instance_lock: arguments: |%s| |%s| |%s|"),
81
 
                 self, context, instance_id, context=context)
 
80
        LOG.info(_("check_instance_lock: arguments: |%(self)s| |%(context)s|"
 
81
                " |%(instance_id)s|") % locals(), context=context)
82
82
        locked = self.get_lock(context, instance_id)
83
83
        admin = context.is_admin
84
84
        LOG.info(_("check_instance_lock: locked: |%s|"), locked,
278
278
        LOG.audit(_("Rebooting instance %s"), instance_id, context=context)
279
279
 
280
280
        if instance_ref['state'] != power_state.RUNNING:
 
281
            state = instance_ref['state']
 
282
            running = power_state.RUNNING
281
283
            LOG.warn(_('trying to reboot a non-running '
282
 
                     'instance: %s (state: %s excepted: %s)'),
283
 
                     instance_id,
284
 
                     instance_ref['state'],
285
 
                     power_state.RUNNING,
 
284
                     'instance: %(instance_id)s (state: %(state)s '
 
285
                     'expected: %(running)s)') % locals(),
286
286
                     context=context)
287
287
 
288
288
        self.db.instance_set_state(context,
307
307
        LOG.audit(_('instance %s: snapshotting'), instance_id,
308
308
                  context=context)
309
309
        if instance_ref['state'] != power_state.RUNNING:
 
310
            state = instance_ref['state']
 
311
            running = power_state.RUNNING
310
312
            LOG.warn(_('trying to snapshot a non-running '
311
 
                       'instance: %s (state: %s excepted: %s)'),
312
 
                     instance_id, instance_ref['state'], power_state.RUNNING)
 
313
                       'instance: %(instance_id)s (state: %(state)s '
 
314
                       'expected: %(running)s)') % locals())
313
315
 
314
316
        self.driver.snapshot(instance_ref, image_id)
315
317
 
517
519
        """Attach a volume to an instance."""
518
520
        context = context.elevated()
519
521
        instance_ref = self.db.instance_get(context, instance_id)
520
 
        LOG.audit(_("instance %s: attaching volume %s to %s"), instance_id,
521
 
                  volume_id, mountpoint, context=context)
 
522
        LOG.audit(_("instance %(instance_id)s: attaching volume %(volume_id)s"
 
523
                " to %(mountpoint)s") % locals(), context=context)
522
524
        dev_path = self.volume_manager.setup_compute_volume(context,
523
525
                                                            volume_id)
524
526
        try:
533
535
            # NOTE(vish): The inline callback eats the exception info so we
534
536
            #             log the traceback here and reraise the same
535
537
            #             ecxception below.
536
 
            LOG.exception(_("instance %s: attach failed %s, removing"),
537
 
                          instance_id, mountpoint, context=context)
 
538
            LOG.exception(_("instance %(instance_id)s: attach failed"
 
539
                    " %(mountpoint)s, removing") % locals(), context=context)
538
540
            self.volume_manager.remove_compute_volume(context,
539
541
                                                      volume_id)
540
542
            raise exc
548
550
        context = context.elevated()
549
551
        instance_ref = self.db.instance_get(context, instance_id)
550
552
        volume_ref = self.db.volume_get(context, volume_id)
551
 
        LOG.audit(_("Detach volume %s from mountpoint %s on instance %s"),
552
 
                  volume_id, volume_ref['mountpoint'], instance_id,
553
 
                  context=context)
 
553
        mp = volume_ref['mountpoint']
 
554
        LOG.audit(_("Detach volume %(volume_id)s from mountpoint %(mp)s"
 
555
                " on instance %(instance_id)s") % locals(), context=context)
554
556
        if instance_ref['name'] not in self.driver.list_instances():
555
557
            LOG.warn(_("Detaching volume from unknown instance %s"),
556
558
                     instance_id, context=context)