summaryrefslogtreecommitdiff
path: root/heat
diff options
context:
space:
mode:
authorAndreas Jaeger <aj@suse.com>2020-04-09 12:31:41 +0200
committerAndreas Jaeger <jaegerandi@gmail.com>2020-04-16 06:43:27 +0000
commit57eb87149ff177ac23be821260fa6e544ad010bf (patch)
tree5f371b1c3daa4aa5efbf2cf796115bfa67854638 /heat
parenta27dc56f525606c1ec1046e5c1f9cc57ca1f9f11 (diff)
downloadheat-57eb87149ff177ac23be821260fa6e544ad010bf.tar.gz
Fix hacking warnings
Fix some warnings found by hacking and enable them again. Change-Id: Ia09de4d0fda752a009b9246b4e6d485601cd9562
Diffstat (limited to 'heat')
-rw-r--r--heat/cmd/all.py21
-rw-r--r--heat/cmd/api.py2
-rw-r--r--heat/cmd/api_cfn.py2
-rw-r--r--heat/cmd/engine.py2
-rw-r--r--heat/cmd/manage.py1
-rw-r--r--heat/cmd/status.py1
-rw-r--r--heat/engine/check_resource.py12
-rw-r--r--heat/engine/properties.py2
-rw-r--r--heat/engine/resource.py12
-rw-r--r--heat/engine/resources/aws/ec2/instance.py5
-rw-r--r--heat/engine/resources/openstack/glance/image.py8
-rw-r--r--heat/engine/resources/openstack/heat/autoscaling_group.py2
-rw-r--r--heat/engine/resources/openstack/mistral/workflow.py10
-rw-r--r--heat/engine/resources/openstack/neutron/lbaas/pool.py4
-rw-r--r--heat/engine/resources/openstack/neutron/sfc/flow_classifier.py4
-rw-r--r--heat/engine/resources/openstack/neutron/sfc/port_pair.py4
-rw-r--r--heat/engine/resources/openstack/neutron/taas/tap_flow.py4
-rw-r--r--heat/engine/resources/openstack/neutron/taas/tap_service.py4
-rw-r--r--heat/engine/resources/openstack/octavia/pool.py4
-rw-r--r--heat/engine/scheduler.py2
-rw-r--r--heat/engine/stack.py8
-rw-r--r--heat/engine/support.py10
-rw-r--r--heat/tests/__init__.py1
-rw-r--r--heat/tests/convergence/framework/message_processor.py1
-rw-r--r--heat/tests/convergence/framework/processes.py1
-rw-r--r--heat/tests/convergence/framework/reality.py1
-rw-r--r--heat/tests/db/test_utils.py2
-rw-r--r--heat/tests/engine/test_dependencies.py20
-rw-r--r--heat/tests/engine/test_scheduler.py4
-rw-r--r--heat/tests/test_constraints.py20
-rw-r--r--heat/tests/test_convg_stack.py2
-rw-r--r--heat/tests/test_properties.py22
-rw-r--r--heat/tests/test_stack_lock.py2
-rw-r--r--heat/tests/test_vpc.py2
34 files changed, 109 insertions, 93 deletions
diff --git a/heat/cmd/all.py b/heat/cmd/all.py
index f1dfc5516..51e0bb039 100644
--- a/heat/cmd/all.py
+++ b/heat/cmd/all.py
@@ -15,6 +15,9 @@
An OpenStack Heat server that can run all services.
"""
+
+# flake8: noqa: E402
+
import eventlet
eventlet.monkey_patch(os=False)
@@ -65,15 +68,15 @@ def _start_service_threads(services):
def launch_all(setup_logging=True):
- if setup_logging:
- logging.register_options(cfg.CONF)
- cfg.CONF(project='heat', prog='heat-all',
- version=version.version_info.version_string())
- if setup_logging:
- logging.setup(cfg.CONF, 'heat-all')
- config.set_config_defaults()
- messaging.setup()
- return _start_service_threads(set(cfg.CONF.heat_all.enabled_services))
+ if setup_logging:
+ logging.register_options(cfg.CONF)
+ cfg.CONF(project='heat', prog='heat-all',
+ version=version.version_info.version_string())
+ if setup_logging:
+ logging.setup(cfg.CONF, 'heat-all')
+ config.set_config_defaults()
+ messaging.setup()
+ return _start_service_threads(set(cfg.CONF.heat_all.enabled_services))
def main():
diff --git a/heat/cmd/api.py b/heat/cmd/api.py
index ba2dd0932..9d968c047 100644
--- a/heat/cmd/api.py
+++ b/heat/cmd/api.py
@@ -16,6 +16,8 @@
An OpenStack ReST API to Heat.
"""
+# flake8: noqa: E402
+
import eventlet
eventlet.monkey_patch(os=False)
diff --git a/heat/cmd/api_cfn.py b/heat/cmd/api_cfn.py
index 2a559a500..b632c0f14 100644
--- a/heat/cmd/api_cfn.py
+++ b/heat/cmd/api_cfn.py
@@ -18,6 +18,8 @@ translates it into a native representation. It then calls the heat-engine via
AMQP RPC to implement them.
"""
+# flake8: noqa: E402
+
import eventlet
eventlet.monkey_patch(os=False)
diff --git a/heat/cmd/engine.py b/heat/cmd/engine.py
index 027ea6626..f30081d7e 100644
--- a/heat/cmd/engine.py
+++ b/heat/cmd/engine.py
@@ -18,6 +18,8 @@ Normal communications is done via the heat API which then calls into this
engine.
"""
+# flake8: noqa: E402
+
import eventlet
eventlet.monkey_patch()
diff --git a/heat/cmd/manage.py b/heat/cmd/manage.py
index 468132d80..6856f12d3 100644
--- a/heat/cmd/manage.py
+++ b/heat/cmd/manage.py
@@ -224,6 +224,7 @@ def add_command_parsers(subparsers):
ServiceManageCommand.add_service_parsers(subparsers)
+
command_opt = cfg.SubCommandOpt('command',
title='Commands',
help=_('Show available commands.'),
diff --git a/heat/cmd/status.py b/heat/cmd/status.py
index 9fb60efc2..3281176f1 100644
--- a/heat/cmd/status.py
+++ b/heat/cmd/status.py
@@ -50,5 +50,6 @@ def main():
return upgradecheck.main(
cfg.CONF, project='heat', upgrade_command=Checks())
+
if __name__ == '__main__':
sys.exit(main())
diff --git a/heat/engine/check_resource.py b/heat/engine/check_resource.py
index 7d12ceeec..edf3fef73 100644
--- a/heat/engine/check_resource.py
+++ b/heat/engine/check_resource.py
@@ -105,11 +105,11 @@ class CheckResource(object):
def _retrigger_new_traversal(self, cnxt, current_traversal, is_update,
stack_id, rsrc_id):
- latest_stack = parser.Stack.load(cnxt, stack_id=stack_id,
- force_reload=True)
- if current_traversal != latest_stack.current_traversal:
- self.retrigger_check_resource(cnxt, is_update, rsrc_id,
- latest_stack)
+ latest_stack = parser.Stack.load(cnxt, stack_id=stack_id,
+ force_reload=True)
+ if current_traversal != latest_stack.current_traversal:
+ self.retrigger_check_resource(cnxt, is_update, rsrc_id,
+ latest_stack)
def _handle_stack_timeout(self, cnxt, stack):
failure_reason = u'Timed out'
@@ -183,7 +183,7 @@ class CheckResource(object):
except scheduler.Timeout:
self._handle_resource_failure(cnxt, is_update, rsrc.id,
stack, u'Timed out')
- except CancelOperation as ex:
+ except CancelOperation:
# Stack is already marked FAILED, so we just need to retrigger
# in case a new traversal has started and is waiting on us.
self._retrigger_new_traversal(cnxt, current_traversal, is_update,
diff --git a/heat/engine/properties.py b/heat/engine/properties.py
index 3e3cf5a43..e58516c9e 100644
--- a/heat/engine/properties.py
+++ b/heat/engine/properties.py
@@ -321,7 +321,7 @@ class Property(object):
value = self.has_default() and self.default() or []
if self.schema.allow_conversion and isinstance(value,
six.string_types):
- value = param_utils.delim_string_to_list(value)
+ value = param_utils.delim_string_to_list(value)
if (not isinstance(value, collections.Sequence) or
isinstance(value, six.string_types)):
raise TypeError(_('"%s" is not a list') % repr(value))
diff --git a/heat/engine/resource.py b/heat/engine/resource.py
index 56612f40f..a55584e19 100644
--- a/heat/engine/resource.py
+++ b/heat/engine/resource.py
@@ -918,7 +918,7 @@ class Resource(status.ResourceStatus):
try:
set_in_progress()
yield
- except exception.UpdateInProgress as ex:
+ except exception.UpdateInProgress:
with excutils.save_and_reraise_exception():
LOG.info('Update in progress for %s', self.name)
except expected_exceptions as ex:
@@ -1587,11 +1587,11 @@ class Resource(status.ResourceStatus):
@classmethod
def check_is_substituted(cls, new_res_type):
- support_status = getattr(cls, 'support_status', None)
- if support_status:
- is_substituted = support_status.is_substituted(new_res_type)
- return is_substituted
- return False
+ support_status = getattr(cls, 'support_status', None)
+ if support_status:
+ is_substituted = support_status.is_substituted(new_res_type)
+ return is_substituted
+ return False
def _persist_update_no_change(self, new_template_id):
"""Persist an update where the resource is unchanged."""
diff --git a/heat/engine/resources/aws/ec2/instance.py b/heat/engine/resources/aws/ec2/instance.py
index 7311eb995..93986a7e2 100644
--- a/heat/engine/resources/aws/ec2/instance.py
+++ b/heat/engine/resources/aws/ec2/instance.py
@@ -17,8 +17,6 @@ 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 _
from heat.engine import attributes
@@ -28,6 +26,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__)
diff --git a/heat/engine/resources/openstack/glance/image.py b/heat/engine/resources/openstack/glance/image.py
index cb571b546..2f0053faa 100644
--- a/heat/engine/resources/openstack/glance/image.py
+++ b/heat/engine/resources/openstack/glance/image.py
@@ -217,8 +217,8 @@ class GlanceWebImage(resource.Resource):
def get_live_resource_data(self):
image_data = super(GlanceWebImage, self).get_live_resource_data()
if image_data.get('status') in ('deleted', 'killed'):
- raise exception.EntityNotFound(entity='Resource',
- name=self.name)
+ raise exception.EntityNotFound(entity='Resource',
+ name=self.name)
return image_data
def parse_live_resource_data(self, resource_properties, resource_data):
@@ -479,8 +479,8 @@ class GlanceImage(resource.Resource):
def get_live_resource_data(self):
image_data = super(GlanceImage, self).get_live_resource_data()
if image_data.get('status') in ('deleted', 'killed'):
- raise exception.EntityNotFound(entity='Resource',
- name=self.name)
+ raise exception.EntityNotFound(entity='Resource',
+ name=self.name)
return image_data
def parse_live_resource_data(self, resource_properties, resource_data):
diff --git a/heat/engine/resources/openstack/heat/autoscaling_group.py b/heat/engine/resources/openstack/heat/autoscaling_group.py
index e288fe20f..be579a252 100644
--- a/heat/engine/resources/openstack/heat/autoscaling_group.py
+++ b/heat/engine/resources/openstack/heat/autoscaling_group.py
@@ -214,7 +214,7 @@ class AutoScalingResourceGroup(aws_asg.AutoScalingGroup):
def _attribute_output_name(self, *attr_path):
return ', '.join(six.text_type(a) for a in attr_path)
- def get_attribute(self, key, *path):
+ def get_attribute(self, key, *path): # noqa: C901
if key == self.CURRENT_SIZE:
return grouputils.get_size(self)
diff --git a/heat/engine/resources/openstack/mistral/workflow.py b/heat/engine/resources/openstack/mistral/workflow.py
index 8794b23d7..10e7b9040 100644
--- a/heat/engine/resources/openstack/mistral/workflow.py
+++ b/heat/engine/resources/openstack/mistral/workflow.py
@@ -442,11 +442,11 @@ class Workflow(signal_responder.SignalResponder,
error=_('Signal data error'),
message=message)
if params is not None and not isinstance(params, dict):
- message = (_('Params must be a map, find a '
- '%s') % type(params))
- raise exception.StackValidationFailed(
- error=_('Signal data error'),
- message=message)
+ message = (_('Params must be a map, find a '
+ '%s') % type(params))
+ raise exception.StackValidationFailed(
+ error=_('Signal data error'),
+ message=message)
def validate(self):
super(Workflow, self).validate()
diff --git a/heat/engine/resources/openstack/neutron/lbaas/pool.py b/heat/engine/resources/openstack/neutron/lbaas/pool.py
index 9e4aa2060..63d2868a6 100644
--- a/heat/engine/resources/openstack/neutron/lbaas/pool.py
+++ b/heat/engine/resources/openstack/neutron/lbaas/pool.py
@@ -197,8 +197,8 @@ class Pool(neutron.NeutronResource):
if (self.properties[self.LISTENER] is None and
self.properties[self.LOADBALANCER] is None):
- raise exception.PropertyUnspecifiedError(self.LISTENER,
- self.LOADBALANCER)
+ raise exception.PropertyUnspecifiedError(self.LISTENER,
+ self.LOADBALANCER)
if self.properties[self.SESSION_PERSISTENCE] is not None:
session_p = self.properties[self.SESSION_PERSISTENCE]
diff --git a/heat/engine/resources/openstack/neutron/sfc/flow_classifier.py b/heat/engine/resources/openstack/neutron/sfc/flow_classifier.py
index b6ddcb488..e5a34d54e 100644
--- a/heat/engine/resources/openstack/neutron/sfc/flow_classifier.py
+++ b/heat/engine/resources/openstack/neutron/sfc/flow_classifier.py
@@ -181,8 +181,8 @@ class FlowClassifier(neutron.NeutronResource):
if self.resource_id is None:
return
with self.client_plugin().ignore_not_found:
- self.client_plugin().delete_ext_resource('flow_classifier',
- self.resource_id)
+ self.client_plugin().delete_ext_resource('flow_classifier',
+ self.resource_id)
def resource_mapping():
diff --git a/heat/engine/resources/openstack/neutron/sfc/port_pair.py b/heat/engine/resources/openstack/neutron/sfc/port_pair.py
index 749f8e45f..bc4070d35 100644
--- a/heat/engine/resources/openstack/neutron/sfc/port_pair.py
+++ b/heat/engine/resources/openstack/neutron/sfc/port_pair.py
@@ -118,8 +118,8 @@ class PortPair(neutron.NeutronResource):
if self.resource_id is None:
return
with self.client_plugin().ignore_not_found:
- self.client_plugin().delete_ext_resource('port_pair',
- self.resource_id)
+ self.client_plugin().delete_ext_resource('port_pair',
+ self.resource_id)
def resource_mapping():
diff --git a/heat/engine/resources/openstack/neutron/taas/tap_flow.py b/heat/engine/resources/openstack/neutron/taas/tap_flow.py
index 7201c67d8..1644ab823 100644
--- a/heat/engine/resources/openstack/neutron/taas/tap_flow.py
+++ b/heat/engine/resources/openstack/neutron/taas/tap_flow.py
@@ -135,8 +135,8 @@ class TapFlow(neutron.NeutronResource):
if self.resource_id is None:
return
with self.client_plugin().ignore_not_found:
- self.client_plugin().delete_ext_resource('tap_flow',
- self.resource_id)
+ self.client_plugin().delete_ext_resource('tap_flow',
+ self.resource_id)
def check_create_complete(self, data):
return self.client_plugin().check_ext_resource_status(
diff --git a/heat/engine/resources/openstack/neutron/taas/tap_service.py b/heat/engine/resources/openstack/neutron/taas/tap_service.py
index 112ed4f23..d44ffab93 100644
--- a/heat/engine/resources/openstack/neutron/taas/tap_service.py
+++ b/heat/engine/resources/openstack/neutron/taas/tap_service.py
@@ -99,8 +99,8 @@ class TapService(neutron.NeutronResource):
if self.resource_id is None:
return
with self.client_plugin().ignore_not_found:
- self.client_plugin().delete_ext_resource('tap_service',
- self.resource_id)
+ self.client_plugin().delete_ext_resource('tap_service',
+ self.resource_id)
def check_create_complete(self, data):
return self.client_plugin().check_ext_resource_status(
diff --git a/heat/engine/resources/openstack/octavia/pool.py b/heat/engine/resources/openstack/octavia/pool.py
index cc5a96971..9bb541aea 100644
--- a/heat/engine/resources/openstack/octavia/pool.py
+++ b/heat/engine/resources/openstack/octavia/pool.py
@@ -188,8 +188,8 @@ class Pool(octavia_base.OctaviaBase):
super(Pool, self).validate()
if (self.properties[self.LISTENER] is None and
self.properties[self.LOADBALANCER] is None):
- raise exception.PropertyUnspecifiedError(self.LISTENER,
- self.LOADBALANCER)
+ raise exception.PropertyUnspecifiedError(self.LISTENER,
+ self.LOADBALANCER)
if self.properties[self.SESSION_PERSISTENCE] is not None:
session_p = self.properties[self.SESSION_PERSISTENCE]
diff --git a/heat/engine/scheduler.py b/heat/engine/scheduler.py
index 5c72d13a1..8b7e8032c 100644
--- a/heat/engine/scheduler.py
+++ b/heat/engine/scheduler.py
@@ -296,7 +296,7 @@ class TaskRunner(object):
return self.__nonzero__()
-def wrappertask(task):
+def wrappertask(task): # noqa: C901
"""Decorator for a task that needs to drive a subtask.
This is essentially a replacement for the Python 3-only "yield from"
diff --git a/heat/engine/stack.py b/heat/engine/stack.py
index f91f8d09f..1b5f65387 100644
--- a/heat/engine/stack.py
+++ b/heat/engine/stack.py
@@ -716,9 +716,9 @@ class Stack(collections.Mapping):
self.user_creds_id = new_creds.id
if self.convergence:
- # create a traversal ID
- self.current_traversal = uuidutils.generate_uuid()
- s['current_traversal'] = self.current_traversal
+ # create a traversal ID
+ self.current_traversal = uuidutils.generate_uuid()
+ s['current_traversal'] = self.current_traversal
new_s = stack_object.Stack.create(self.context, s)
self.id = new_s.id
@@ -1872,7 +1872,7 @@ class Stack(collections.Mapping):
else:
self.clients.client('keystone').delete_trust(
trust_id)
- except Exception as ex:
+ except Exception:
# We want the admin to be able to delete the stack
# Do not FAIL a delete when we cannot delete a trust.
# We already carry through and delete the credentials
diff --git a/heat/engine/support.py b/heat/engine/support.py
index fd765e31d..d654a7150 100644
--- a/heat/engine/support.py
+++ b/heat/engine/support.py
@@ -54,11 +54,11 @@ class SupportStatus(object):
self.previous_status = None
def to_dict(self):
- return {'status': self.status,
- 'message': self.message,
- 'version': self.version,
- 'previous_status': self.previous_status.to_dict()
- if self.previous_status is not None else None}
+ return {'status': self.status,
+ 'message': self.message,
+ 'version': self.version,
+ 'previous_status': self.previous_status.to_dict()
+ if self.previous_status is not None else None}
def is_substituted(self, substitute_class):
if self.substitute_class is None:
diff --git a/heat/tests/__init__.py b/heat/tests/__init__.py
index bac6de060..efeae0bf6 100644
--- a/heat/tests/__init__.py
+++ b/heat/tests/__init__.py
@@ -18,6 +18,7 @@ import oslo_i18n as i18n
def fake_translate_msgid(msgid, domain, desired_locale=None):
return msgid
+
i18n.enable_lazy()
# To ensure messages don't really get translated while running tests.
diff --git a/heat/tests/convergence/framework/message_processor.py b/heat/tests/convergence/framework/message_processor.py
index 99d0bf281..071f56da7 100644
--- a/heat/tests/convergence/framework/message_processor.py
+++ b/heat/tests/convergence/framework/message_processor.py
@@ -112,4 +112,5 @@ class MessageProcessor(object):
"""Delete all the messages from the queue."""
self.queue.clear()
+
__all__ = ['MessageProcessor', 'asynchronous']
diff --git a/heat/tests/convergence/framework/processes.py b/heat/tests/convergence/framework/processes.py
index 5104a62b3..992b2b4c0 100644
--- a/heat/tests/convergence/framework/processes.py
+++ b/heat/tests/convergence/framework/processes.py
@@ -41,4 +41,5 @@ class Processes(object):
self.engine.clear()
self.worker.clear()
+
Processes()
diff --git a/heat/tests/convergence/framework/reality.py b/heat/tests/convergence/framework/reality.py
index 4951541dc..dcd7a79c7 100644
--- a/heat/tests/convergence/framework/reality.py
+++ b/heat/tests/convergence/framework/reality.py
@@ -48,4 +48,5 @@ class RealityStore(object):
prop_name)
return res_data.value
+
reality = RealityStore()
diff --git a/heat/tests/db/test_utils.py b/heat/tests/db/test_utils.py
index e44988f16..c6bc30922 100644
--- a/heat/tests/db/test_utils.py
+++ b/heat/tests/db/test_utils.py
@@ -26,7 +26,7 @@ def _has_constraint(cset, ctype, cname):
and c.name == cname):
return True
else:
- return False
+ return False
class DBMigrationUtilsTest(common.HeatTestCase):
diff --git a/heat/tests/engine/test_dependencies.py b/heat/tests/engine/test_dependencies.py
index 9f6d0c82b..c27e9a14f 100644
--- a/heat/tests/engine/test_dependencies.py
+++ b/heat/tests/engine/test_dependencies.py
@@ -57,16 +57,16 @@ class dependenciesTest(common.HeatTestCase):
def test_single_node(self):
d = dependencies.Dependencies([('only', None)])
- l = list(iter(d))
- self.assertEqual(1, len(l))
- self.assertEqual('only', l[0])
+ li = list(iter(d))
+ self.assertEqual(1, len(li))
+ self.assertEqual('only', li[0])
def test_disjoint(self):
d = dependencies.Dependencies([('1', None), ('2', None)])
- l = list(iter(d))
- self.assertEqual(2, len(l))
- self.assertIn('1', l)
- self.assertIn('2', l)
+ li = list(iter(d))
+ self.assertEqual(2, len(li))
+ self.assertIn('1', li)
+ self.assertIn('2', li)
def test_single_fwd(self):
self._dep_test_fwd(('second', 'first'))
@@ -170,9 +170,9 @@ class dependenciesTest(common.HeatTestCase):
def test_single_partial(self):
d = dependencies.Dependencies([('last', 'first')])
p = d['last']
- l = list(iter(p))
- self.assertEqual(1, len(l))
- self.assertEqual('last', l[0])
+ li = list(iter(p))
+ self.assertEqual(1, len(li))
+ self.assertEqual('last', li[0])
def test_simple_partial(self):
d = dependencies.Dependencies([('last', 'middle'),
diff --git a/heat/tests/engine/test_scheduler.py b/heat/tests/engine/test_scheduler.py
index b688e6a9b..229834cde 100644
--- a/heat/tests/engine/test_scheduler.py
+++ b/heat/tests/engine/test_scheduler.py
@@ -1242,9 +1242,9 @@ class DescriptionTest(common.HeatTestCase):
self.assertEqual('f', scheduler.task_description(f))
def test_lambda(self):
- l = lambda: None
+ lam = lambda: None # noqa: E731
- self.assertEqual('<lambda>', scheduler.task_description(l))
+ self.assertEqual('<lambda>', scheduler.task_description(lam))
def test_method(self):
class C(object):
diff --git a/heat/tests/test_constraints.py b/heat/tests/test_constraints.py
index c2f87a68d..a42a53ae2 100644
--- a/heat/tests/test_constraints.py
+++ b/heat/tests/test_constraints.py
@@ -81,16 +81,16 @@ class SchemaTest(common.HeatTestCase):
self.assertRaises(ValueError, r.validate, 6)
def test_length_validate(self):
- l = constraints.Length(min=5, max=5, description='a range')
- l.validate('abcde')
+ cl = constraints.Length(min=5, max=5, description='a range')
+ cl.validate('abcde')
def test_length_min_fail(self):
- l = constraints.Length(min=5, description='a range')
- self.assertRaises(ValueError, l.validate, 'abcd')
+ cl = constraints.Length(min=5, description='a range')
+ self.assertRaises(ValueError, cl.validate, 'abcd')
def test_length_max_fail(self):
- l = constraints.Length(max=5, description='a range')
- self.assertRaises(ValueError, l.validate, 'abcdef')
+ cl = constraints.Length(max=5, description='a range')
+ self.assertRaises(ValueError, cl.validate, 'abcdef')
def test_modulo_validate(self):
r = constraints.Modulo(step=2, offset=1, description='a modulo')
@@ -196,8 +196,8 @@ class SchemaTest(common.HeatTestCase):
s = constraints.Schema(constraints.Schema.STRING, 'A string',
default='wibble',
constraints=[constraints.Length(4, 8)])
- l = constraints.Schema(constraints.Schema.LIST, 'A list', schema=s)
- self.assertEqual(d, dict(l))
+ ls = constraints.Schema(constraints.Schema.LIST, 'A list', schema=s)
+ self.assertEqual(d, dict(ls))
def test_schema_map_schema(self):
d = {
@@ -252,8 +252,8 @@ class SchemaTest(common.HeatTestCase):
constraints=[constraints.Length(4, 8)])
m = constraints.Schema(constraints.Schema.MAP, 'A map',
schema={'Foo': s})
- l = constraints.Schema(constraints.Schema.LIST, 'A list', schema=m)
- self.assertEqual(d, dict(l))
+ ls = constraints.Schema(constraints.Schema.LIST, 'A list', schema=m)
+ self.assertEqual(d, dict(ls))
def test_invalid_type(self):
self.assertRaises(exception.InvalidSchemaError, constraints.Schema,
diff --git a/heat/tests/test_convg_stack.py b/heat/tests/test_convg_stack.py
index a642b51cc..1d2476d0b 100644
--- a/heat/tests/test_convg_stack.py
+++ b/heat/tests/test_convg_stack.py
@@ -194,7 +194,7 @@ class StackConvergenceCreateUpdateDeleteTest(common.HeatTestCase):
[[4, False], [3, False]],
[[4, False], [4, True]]]),
sorted(stack_db.current_deps['edges']))
- '''
+ r'''
To visualize:
G(7, True) H(6, True)
diff --git a/heat/tests/test_properties.py b/heat/tests/test_properties.py
index 166856617..748155961 100644
--- a/heat/tests/test_properties.py
+++ b/heat/tests/test_properties.py
@@ -71,8 +71,8 @@ class PropertySchemaTest(common.HeatTestCase):
s = properties.Schema(properties.Schema.STRING, 'A string',
default='wibble',
constraints=[constraints.Length(4, 8)])
- l = properties.Schema(properties.Schema.LIST, 'A list', schema=s)
- self.assertEqual(d, dict(l))
+ ls = properties.Schema(properties.Schema.LIST, 'A list', schema=s)
+ self.assertEqual(d, dict(ls))
def test_schema_map_schema(self):
d = {
@@ -137,8 +137,8 @@ class PropertySchemaTest(common.HeatTestCase):
constraints=[constraints.Length(4, 8)])
m = properties.Schema(properties.Schema.MAP, 'A map',
schema={'Foo': s})
- l = properties.Schema(properties.Schema.LIST, 'A list', schema=m)
- self.assertEqual(d, dict(l))
+ ls = properties.Schema(properties.Schema.LIST, 'A list', schema=m)
+ self.assertEqual(d, dict(ls))
def test_all_resource_schemata(self):
for resource_type in resources.global_env().get_types():
@@ -292,7 +292,7 @@ class PropertySchemaTest(common.HeatTestCase):
self.assertEqual('[a-z]*', c.pattern)
def test_from_legacy_list(self):
- l = properties.Schema.from_legacy({
+ ls = properties.Schema.from_legacy({
'Type': 'List',
'Default': ['wibble'],
'Schema': {
@@ -301,15 +301,15 @@ class PropertySchemaTest(common.HeatTestCase):
'MaxLength': 8,
}
})
- self.assertEqual(properties.Schema.LIST, l.type)
- self.assertEqual(['wibble'], l.default)
+ self.assertEqual(properties.Schema.LIST, ls.type)
+ self.assertEqual(['wibble'], ls.default)
- ss = l.schema[0]
+ ss = ls.schema[0]
self.assertEqual(properties.Schema.STRING, ss.type)
self.assertEqual('wibble', ss.default)
def test_from_legacy_map(self):
- l = properties.Schema.from_legacy({
+ ls = properties.Schema.from_legacy({
'Type': 'Map',
'Schema': {
'foo': {
@@ -318,9 +318,9 @@ class PropertySchemaTest(common.HeatTestCase):
}
}
})
- self.assertEqual(properties.Schema.MAP, l.type)
+ self.assertEqual(properties.Schema.MAP, ls.type)
- ss = l.schema['foo']
+ ss = ls.schema['foo']
self.assertEqual(properties.Schema.STRING, ss.type)
self.assertEqual('wibble', ss.default)
diff --git a/heat/tests/test_stack_lock.py b/heat/tests/test_stack_lock.py
index 891f1f41a..272e689a0 100644
--- a/heat/tests/test_stack_lock.py
+++ b/heat/tests/test_stack_lock.py
@@ -36,7 +36,7 @@ class StackLockTest(common.HeatTestCase):
stack_object.Stack, 'get_by_id', return_value=stack)
class TestThreadLockException(Exception):
- pass
+ pass
def test_successful_acquire_new_lock(self):
mock_create = self.patchobject(stack_lock_object.StackLock,
diff --git a/heat/tests/test_vpc.py b/heat/tests/test_vpc.py
index 373f8e165..06eb4b1de 100644
--- a/heat/tests/test_vpc.py
+++ b/heat/tests/test_vpc.py
@@ -532,7 +532,7 @@ Resources:
'name': self.nic_name,
'admin_state_up': True}
if security_groups:
- self._port['security_groups'] = security_groups
+ self._port['security_groups'] = security_groups
self.mockclient.create_port.return_value = {
'port': {