~midokura/nova/midostack-oneiric

« back to all changes in this revision

Viewing changes to nova/compute/manager.py

  • Committer: Tarmac
  • Author(s): Yuriy Taraday
  • Date: 2011-06-30 15:37:58 UTC
  • mfrom: (1188.4.5 hostname-fix)
  • Revision ID: tarmac-20110630153758-anvaapptx9f8ygan
Theese changes eliminate dependancy between hostname and ec2-id.
As I understand, there already were no such dependancy, but still we had confusing names in code.
Also I added more sophisticated generation of default hostname to give user possibility to set the custom one.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1194
1194
 
1195
1195
        # Getting instance info
1196
1196
        instance_ref = self.db.instance_get(context, instance_id)
1197
 
        ec2_id = instance_ref['hostname']
 
1197
        hostname = instance_ref['hostname']
1198
1198
 
1199
1199
        # Getting fixed ips
1200
1200
        fixed_ip = self.db.instance_get_fixed_address(context, instance_id)
1203
1203
 
1204
1204
        # If any volume is mounted, prepare here.
1205
1205
        if not instance_ref['volumes']:
1206
 
            LOG.info(_("%s has no volume."), ec2_id)
 
1206
            LOG.info(_("%s has no volume."), hostname)
1207
1207
        else:
1208
1208
            for v in instance_ref['volumes']:
1209
1209
                self.volume_manager.setup_compute_volume(context, v['id'])
1226
1226
                    raise
1227
1227
                else:
1228
1228
                    LOG.warn(_("setup_compute_network() failed %(cnt)d."
1229
 
                               "Retry up to %(max_retry)d for %(ec2_id)s.")
 
1229
                               "Retry up to %(max_retry)d for %(hostname)s.")
1230
1230
                               % locals())
1231
1231
                    time.sleep(1)
1232
1232