summaryrefslogtreecommitdiff
path: root/heat/engine/resources/aws/ec2/instance.py
diff options
context:
space:
mode:
Diffstat (limited to 'heat/engine/resources/aws/ec2/instance.py')
-rw-r--r--heat/engine/resources/aws/ec2/instance.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/heat/engine/resources/aws/ec2/instance.py b/heat/engine/resources/aws/ec2/instance.py
index e35a5b3ad..fc536c29f 100644
--- a/heat/engine/resources/aws/ec2/instance.py
+++ b/heat/engine/resources/aws/ec2/instance.py
@@ -15,9 +15,6 @@ import copy
from oslo_config import cfg
from oslo_log import log as logging
-import six
-
-cfg.CONF.import_opt('max_server_name_length', 'heat.common.config')
from heat.common import exception
from heat.common.i18n import _
@@ -28,6 +25,9 @@ from heat.engine import properties
from heat.engine import resource
from heat.engine.resources import scheduler_hints as sh
+
+cfg.CONF.import_opt('max_server_name_length', 'heat.common.config')
+
LOG = logging.getLogger(__name__)
@@ -396,7 +396,7 @@ class Instance(resource.Resource, sh.SchedulerHintsMixin):
LOG.info('%(name)s._resolve_attribute(%(attname)s) == %(res)s',
{'name': self.name, 'attname': name, 'res': res})
- return six.text_type(res) if res else None
+ return str(res) if res else None
def _port_data_delete(self):
# delete the port data which implicit-created
@@ -415,7 +415,7 @@ class Instance(resource.Resource, sh.SchedulerHintsMixin):
unsorted_nics = []
for entry in network_interfaces:
nic = (entry
- if not isinstance(entry, six.string_types)
+ if not isinstance(entry, str)
else {'NetworkInterfaceId': entry,
'DeviceIndex': len(unsorted_nics)})
unsorted_nics.append(nic)
@@ -520,7 +520,7 @@ class Instance(resource.Resource, sh.SchedulerHintsMixin):
hint = tm[self.NOVA_SCHEDULER_HINT_KEY]
hint_value = tm[self.NOVA_SCHEDULER_HINT_VALUE]
if hint in scheduler_hints:
- if isinstance(scheduler_hints[hint], six.string_types):
+ if isinstance(scheduler_hints[hint], str):
scheduler_hints[hint] = [scheduler_hints[hint]]
scheduler_hints[hint].append(hint_value)
else:
@@ -558,6 +558,7 @@ class Instance(resource.Resource, sh.SchedulerHintsMixin):
if server is not None:
self.resource_id_set(server.id)
+ assert server is not None
creator = progress.ServerCreateProgress(server.id)
attachers = []
for vol_id, device in self.volumes():
@@ -864,7 +865,7 @@ class Instance(resource.Resource, sh.SchedulerHintsMixin):
status = cp.get_status(server)
LOG.debug('%(name)s check_suspend_complete status = %(status)s',
{'name': self.name, 'status': status})
- if status in list(cp.deferred_server_statuses + ['ACTIVE']):
+ if status in (cp.deferred_server_statuses | {'ACTIVE'}):
return status == 'SUSPENDED'
else:
exc = exception.ResourceUnknownStatus(