diff options
author | Takashi Natsume <takanattie@gmail.com> | 2020-05-14 14:35:21 +0000 |
---|---|---|
committer | Takashi Natsume <takanattie@gmail.com> | 2020-12-13 11:25:31 +0000 |
commit | 383e2a8bdcc9210cbe9719d3470fe15b787d46b0 (patch) | |
tree | c557f23bf49e83b877afb39010cf4594f0909a4e /nova/conductor | |
parent | 07462dd0050fbfea89e517759b312b67a368e279 (diff) | |
download | nova-383e2a8bdcc9210cbe9719d3470fe15b787d46b0.tar.gz |
Remove six.text_type (1/2)
Replace six.text_type with str.
A subsequent patch will replace other six.text_type.
Change-Id: I23bb9e539d08f5c6202909054c2dd49b6c7a7a0e
Implements: blueprint six-removal
Signed-off-by: Takashi Natsume <takanattie@gmail.com>
Diffstat (limited to 'nova/conductor')
-rw-r--r-- | nova/conductor/manager.py | 7 | ||||
-rw-r--r-- | nova/conductor/tasks/live_migrate.py | 4 |
2 files changed, 4 insertions, 7 deletions
diff --git a/nova/conductor/manager.py b/nova/conductor/manager.py index cb5d2caa68..4824a1a3c1 100644 --- a/nova/conductor/manager.py +++ b/nova/conductor/manager.py @@ -29,7 +29,6 @@ from oslo_serialization import jsonutils from oslo_utils import excutils from oslo_utils import timeutils from oslo_utils import versionutils -import six from nova.accelerator import cyborg from nova import availability_zones @@ -498,7 +497,7 @@ class ComputeTaskManager(base.Base): task_state=None) migration.status = 'error' migration.save() - raise exception.MigrationError(reason=six.text_type(ex)) + raise exception.MigrationError(reason=str(ex)) def _build_live_migrate_task(self, context, instance, destination, block_migration, disk_over_commit, migration, @@ -1122,7 +1121,7 @@ class ComputeTaskManager(base.Base): {'vm_state': vm_states.ERROR, 'task_state': None}, ex, request_spec) LOG.warning('Rebuild failed: %s', - six.text_type(ex), instance=instance) + str(ex), instance=instance) except exception.NoValidHost: with excutils.save_and_reraise_exception(): if migration: @@ -1214,7 +1213,7 @@ class ComputeTaskManager(base.Base): {'vm_state': vm_states.ERROR, 'task_state': None}, ex, request_spec) LOG.warning('Rebuild failed: %s', - six.text_type(ex), instance=instance) + str(ex), instance=instance) compute_utils.notify_about_instance_usage( self.notifier, context, instance, "rebuild.scheduled") diff --git a/nova/conductor/tasks/live_migrate.py b/nova/conductor/tasks/live_migrate.py index de8a91fd9a..d8531bad86 100644 --- a/nova/conductor/tasks/live_migrate.py +++ b/nova/conductor/tasks/live_migrate.py @@ -13,7 +13,6 @@ from oslo_log import log as logging import oslo_messaging as messaging from oslo_utils import excutils -import six from nova import availability_zones from nova.compute import power_state @@ -533,8 +532,7 @@ class LiveMigrationTask(base.TaskBase): # Note(ShaoHe Feng) There are types of RemoteError, such as # NoSuchMethod, UnsupportedVersion, we can distinguish it by # ex.exc_type. - raise exception.MigrationSchedulerRPCError( - reason=six.text_type(ex)) + raise exception.MigrationSchedulerRPCError(reason=str(ex)) scheduler_utils.fill_provider_mapping(request_spec, selection) |