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/virt/powervm | |
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/virt/powervm')
-rw-r--r-- | nova/virt/powervm/driver.py | 3 | ||||
-rw-r--r-- | nova/virt/powervm/vif.py | 3 | ||||
-rw-r--r-- | nova/virt/powervm/vm.py | 7 | ||||
-rw-r--r-- | nova/virt/powervm/volume/fcvscsi.py | 3 |
4 files changed, 6 insertions, 10 deletions
diff --git a/nova/virt/powervm/driver.py b/nova/virt/powervm/driver.py index 6b862ca566..2fbdd6d178 100644 --- a/nova/virt/powervm/driver.py +++ b/nova/virt/powervm/driver.py @@ -26,7 +26,6 @@ from pypowervm.tasks import partition as pvm_par from pypowervm.tasks import storage as pvm_stor from pypowervm.tasks import vterm as pvm_vterm from pypowervm.wrappers import managed_system as pvm_ms -import six from taskflow.patterns import linear_flow as tf_lf from nova.compute import task_states @@ -400,7 +399,7 @@ class PowerVMDriver(driver.ComputeDriver): except pvm_exc.Error as e: LOG.exception("PowerVM error during destroy.", instance=instance) # Convert to a Nova exception - raise exc.InstanceTerminationFailure(reason=six.text_type(e)) + raise exc.InstanceTerminationFailure(reason=str(e)) def snapshot(self, context, instance, image_id, update_task_state): """Snapshots the specified instance. diff --git a/nova/virt/powervm/vif.py b/nova/virt/powervm/vif.py index 6662249539..8ab591a15d 100644 --- a/nova/virt/powervm/vif.py +++ b/nova/virt/powervm/vif.py @@ -24,7 +24,6 @@ from pypowervm import exceptions as pvm_ex from pypowervm.tasks import cna as pvm_cna from pypowervm.tasks import partition as pvm_par from pypowervm.wrappers import event as pvm_evt -import six from nova import exception from nova.network import model as network_model @@ -210,7 +209,7 @@ class PvmVifDriver(metaclass=abc.ABCMeta): LOG.exception('Unable to unplug VIF with mac %(mac)s.', {'mac': vif['address']}, instance=self.instance) raise exception.VirtualInterfaceUnplugException( - reason=six.text_type(e)) + reason=str(e)) return cna_w @staticmethod diff --git a/nova/virt/powervm/vm.py b/nova/virt/powervm/vm.py index fc4cbbffa6..2e5247551f 100644 --- a/nova/virt/powervm/vm.py +++ b/nova/virt/powervm/vm.py @@ -32,7 +32,6 @@ from pypowervm.wrappers import base_partition as pvm_bp from pypowervm.wrappers import logical_partition as pvm_lpar from pypowervm.wrappers import network as pvm_net from pypowervm.wrappers import shared_proc_pool as pvm_spp -import six from nova.compute import power_state from nova import conf @@ -153,7 +152,7 @@ def power_on(adapter, instance): except pvm_exc.Error as e: LOG.exception("PowerVM error during power_on.", instance=instance) - raise exc.InstancePowerOnFailure(reason=six.text_type(e)) + raise exc.InstancePowerOnFailure(reason=str(e)) def power_off(adapter, instance, force_immediate=False, timeout=None): @@ -189,7 +188,7 @@ def power_off(adapter, instance, force_immediate=False, timeout=None): except pvm_exc.Error as e: LOG.exception("PowerVM error during power_off.", instance=instance) - raise exc.InstancePowerOffFailure(reason=six.text_type(e)) + raise exc.InstancePowerOffFailure(reason=str(e)) else: LOG.debug("Power off not required for instance %(inst)s.", {'inst': instance.name}) @@ -221,7 +220,7 @@ def reboot(adapter, instance, hard): power.power_on(entry, None) except pvm_exc.Error as e: LOG.exception("PowerVM error during reboot.", instance=instance) - raise exc.InstanceRebootFailure(reason=six.text_type(e)) + raise exc.InstanceRebootFailure(reason=str(e)) def delete_lpar(adapter, instance): diff --git a/nova/virt/powervm/volume/fcvscsi.py b/nova/virt/powervm/volume/fcvscsi.py index 74f7a37c74..cf2c6e4d25 100644 --- a/nova/virt/powervm/volume/fcvscsi.py +++ b/nova/virt/powervm/volume/fcvscsi.py @@ -23,7 +23,6 @@ from pypowervm.tasks import scsi_mapper as tsk_map from pypowervm.utils import transaction as pvm_tx from pypowervm.wrappers import storage as pvm_stor from pypowervm.wrappers import virtual_io_server as pvm_vios -import six from taskflow import task from nova import conf as cfg @@ -326,7 +325,7 @@ class FCVscsiVolumeAdapter(object): except Exception as e: LOG.exception('PowerVM error detaching volume from virtual ' 'machine.', instance=self.instance) - ex_args = {'volume_id': self.volume_id, 'reason': six.text_type(e)} + ex_args = {'volume_id': self.volume_id, 'reason': str(e)} raise exc.VolumeDetachFailed(**ex_args) self.stg_ftsk.execute() |