Merge "Removes unused "server" from taskmanager"

This commit is contained in:
Jenkins 2014-01-17 12:00:45 +00:00 committed by Gerrit Code Review
commit 68a5481911

View File

@ -165,14 +165,14 @@ class FreshInstanceTasks(FreshInstance, NotifyMixin, ConfigurationMixin):
"instance: %s") % self.id) "instance: %s") % self.id)
if use_heat: if use_heat:
server, volume_info = self._create_server_volume_heat( volume_info = self._create_server_volume_heat(
flavor, flavor,
image_id, image_id,
datastore_manager, datastore_manager,
volume_size, volume_size,
availability_zone) availability_zone)
elif use_nova_server_volume: elif use_nova_server_volume:
server, volume_info = self._create_server_volume( volume_info = self._create_server_volume(
flavor['id'], flavor['id'],
image_id, image_id,
security_groups, security_groups,
@ -180,7 +180,7 @@ class FreshInstanceTasks(FreshInstance, NotifyMixin, ConfigurationMixin):
volume_size, volume_size,
availability_zone) availability_zone)
else: else:
server, volume_info = self._create_server_volume_individually( volume_info = self._create_server_volume_individually(
flavor['id'], flavor['id'],
image_id, image_id,
security_groups, security_groups,
@ -190,18 +190,17 @@ class FreshInstanceTasks(FreshInstance, NotifyMixin, ConfigurationMixin):
config = self._render_config(datastore_manager, flavor, self.id) config = self._render_config(datastore_manager, flavor, self.id)
if server: backup_info = None
backup_info = None if backup_id is not None:
if backup_id is not None:
backup = bkup_models.Backup.get_by_id(self.context, backup_id) backup = bkup_models.Backup.get_by_id(self.context, backup_id)
backup_info = {'id': backup_id, backup_info = {'id': backup_id,
'location': backup.location, 'location': backup.location,
'type': backup.backup_type, 'type': backup.backup_type,
'checksum': backup.checksum, 'checksum': backup.checksum,
} }
self._guest_prepare(server, flavor['ram'], volume_info, self._guest_prepare(flavor['ram'], volume_info,
packages, databases, users, backup_info, packages, databases, users, backup_info,
config.config_contents, root_password) config.config_contents, root_password)
if not self.db_info.task_status.is_error: if not self.db_info.task_status.is_error:
self.update_db(task_status=inst_models.InstanceTasks.NONE) self.update_db(task_status=inst_models.InstanceTasks.NONE)
@ -335,7 +334,7 @@ class FreshInstanceTasks(FreshInstance, NotifyMixin, ConfigurationMixin):
mount_point = CONF.mount_point mount_point = CONF.mount_point
volume_info = {'device_path': device_path, 'mount_point': mount_point} volume_info = {'device_path': device_path, 'mount_point': mount_point}
LOG.debug(_("end _create_server_volume for id: %s") % self.id) LOG.debug(_("end _create_server_volume for id: %s") % self.id)
return server, volume_info return volume_info
def _create_server_volume_heat(self, flavor, image_id, def _create_server_volume_heat(self, flavor, image_id,
datastore_manager, datastore_manager,
@ -388,7 +387,7 @@ class FreshInstanceTasks(FreshInstance, NotifyMixin, ConfigurationMixin):
volume_info = {'device_path': device_path, 'mount_point': mount_point} volume_info = {'device_path': device_path, 'mount_point': mount_point}
LOG.debug(_("end _create_server_volume_heat for id: %s") % self.id) LOG.debug(_("end _create_server_volume_heat for id: %s") % self.id)
return {'id': instance_id}, volume_info return volume_info
def _create_server_volume_individually(self, flavor_id, image_id, def _create_server_volume_individually(self, flavor_id, image_id,
security_groups, datastore_manager, security_groups, datastore_manager,
@ -413,7 +412,7 @@ class FreshInstanceTasks(FreshInstance, NotifyMixin, ConfigurationMixin):
self._log_and_raise(e, msg, err) self._log_and_raise(e, msg, err)
LOG.debug(_("end _create_server_volume_individually for id: %s") % LOG.debug(_("end _create_server_volume_individually for id: %s") %
self.id) self.id)
return server, volume_info return volume_info
def _build_volume_info(self, volume_size=None): def _build_volume_info(self, volume_size=None):
volume_info = None volume_info = None
@ -519,7 +518,7 @@ class FreshInstanceTasks(FreshInstance, NotifyMixin, ConfigurationMixin):
{'server_id': server.id, 'id': self.id}) {'server_id': server.id, 'id': self.id})
return server return server
def _guest_prepare(self, server, flavor_ram, volume_info, def _guest_prepare(self, flavor_ram, volume_info,
packages, databases, users, backup_info=None, packages, databases, users, backup_info=None,
config_contents=None, root_password=None): config_contents=None, root_password=None):
LOG.info(_("Entering guest_prepare")) LOG.info(_("Entering guest_prepare"))