diff --git a/contrib/rackspace/rackspace/resources/cloud_loadbalancer.py b/contrib/rackspace/rackspace/resources/cloud_loadbalancer.py index c5edcad77..773faa822 100644 --- a/contrib/rackspace/rackspace/resources/cloud_loadbalancer.py +++ b/contrib/rackspace/rackspace/resources/cloud_loadbalancer.py @@ -212,8 +212,8 @@ class CloudLoadBalancer(resource.Resource): properties.Schema.LIST, required=True, description=(_("IP addresses for the load balancer " - "node. Must have at least one " - "address.")), + "node. Must have at least one " + "address.")), schema=properties.Schema( properties.Schema.STRING ) diff --git a/heat/common/heat_keystoneclient.py b/heat/common/heat_keystoneclient.py index 32cd5268c..94aa4776c 100644 --- a/heat/common/heat_keystoneclient.py +++ b/heat/common/heat_keystoneclient.py @@ -105,10 +105,10 @@ class KeystoneClientV3(object): if self.stack_domain: if not (self.domain_admin_user and self.domain_admin_password): raise exception.Error(_('heat.conf misconfigured, cannot ' - 'specify "stack_user_domain_id" or ' - '"stack_user_domain_name" without ' - '"stack_domain_admin" and ' - '"stack_domain_admin_password"')) + 'specify "stack_user_domain_id" or ' + '"stack_user_domain_name" without ' + '"stack_domain_admin" and ' + '"stack_domain_admin_password"')) else: LOG.warn(_LW('stack_user_domain_id or stack_user_domain_name not ' 'set in heat.conf falling back to using default')) diff --git a/heat/engine/resources/template_resource.py b/heat/engine/resources/template_resource.py index d7abf7b30..817bade5e 100644 --- a/heat/engine/resources/template_resource.py +++ b/heat/engine/resources/template_resource.py @@ -87,7 +87,7 @@ class TemplateResource(stack_resource.StackResource): return ((properties.Properties.schema_from_params( tmpl.param_schemata(param_defaults))), (attributes.Attributes.schema_from_outputs( - tmpl[tmpl.OUTPUTS]))) + tmpl[tmpl.OUTPUTS]))) def _generate_schema(self, definition): self._parsed_nested = None diff --git a/heat/tests/test_api_cfn_v1.py b/heat/tests/test_api_cfn_v1.py index 108f923fb..18c05be81 100644 --- a/heat/tests/test_api_cfn_v1.py +++ b/heat/tests/test_api_cfn_v1.py @@ -264,20 +264,20 @@ class CfnStackControllerTest(common.HeatTestCase): u'DBRootPassword': u'admin', u'DBPassword': u'admin', u'DBName': u'wordpress'}, - u'outputs': - [{u'output_key': u'WebsiteURL', - u'description': u'URL for Wordpress wiki', - u'output_value': u'http://10.0.0.8/wordpress'}], - u'stack_status_reason': u'Stack successfully created', - u'creation_time': u'2012-07-09T09:12:45Z', - u'stack_name': u'wordpress', - u'notification_topics': [], - u'stack_action': u'CREATE', - u'stack_status': u'COMPLETE', - u'description': u'blah', - u'disable_rollback': 'true', - u'timeout_mins':60, - u'capabilities':[]}] + u'outputs': + [{u'output_key': u'WebsiteURL', + u'description': u'URL for Wordpress wiki', + u'output_value': u'http://10.0.0.8/wordpress'}], + u'stack_status_reason': u'Stack successfully created', + u'creation_time': u'2012-07-09T09:12:45Z', + u'stack_name': u'wordpress', + u'notification_topics': [], + u'stack_action': u'CREATE', + u'stack_status': u'COMPLETE', + u'description': u'blah', + u'disable_rollback': 'true', + u'timeout_mins':60, + u'capabilities':[]}] self.m.StubOutWithMock(rpc_client.EngineClient, 'call') rpc_client.EngineClient.call( diff --git a/heat/tests/test_api_openstack_v1.py b/heat/tests/test_api_openstack_v1.py index 151339324..a374306fd 100644 --- a/heat/tests/test_api_openstack_v1.py +++ b/heat/tests/test_api_openstack_v1.py @@ -839,7 +839,7 @@ class StackControllerTest(ControllerTest, common.HeatTestCase): req.context, ('create_stack', {'stack_name': identity.stack_name, - 'template': template, + 'template': template, 'params': {'parameters': parameters, 'parameter_defaults': {}, 'resource_registry': {}}, diff --git a/heat/tests/test_engine_service.py b/heat/tests/test_engine_service.py index 143db8082..7771a0340 100644 --- a/heat/tests/test_engine_service.py +++ b/heat/tests/test_engine_service.py @@ -667,9 +667,9 @@ class StackServiceCreateUpdateDeleteTest(common.HeatTestCase): generic_rsrc.GenericResource) tpl = {'HeatTemplateFormatVersion': '2012-12-12', 'Resources': { - 'A': {'Type': 'GenericResourceType'}, - 'B': {'Type': 'GenericResourceType'}, - 'C': {'Type': 'GenericResourceType'}}} + 'A': {'Type': 'GenericResourceType'}, + 'B': {'Type': 'GenericResourceType'}, + 'C': {'Type': 'GenericResourceType'}}} template = templatem.Template(tpl) stack = parser.Stack(self.ctx, stack_name, template, @@ -708,9 +708,9 @@ class StackServiceCreateUpdateDeleteTest(common.HeatTestCase): generic_rsrc.GenericResource) tpl = {'HeatTemplateFormatVersion': '2012-12-12', 'Resources': { - 'A': {'Type': 'GenericResourceType'}, - 'B': {'Type': 'GenericResourceType'}, - 'C': {'Type': 'GenericResourceType'}}} + 'A': {'Type': 'GenericResourceType'}, + 'B': {'Type': 'GenericResourceType'}, + 'C': {'Type': 'GenericResourceType'}}} cfg.CONF.set_override('max_resources_per_stack', 2) ex = self.assertRaises(dispatcher.ExpectedException, self.man.create_stack, self.ctx, stack_name, @@ -1108,9 +1108,9 @@ class StackServiceCreateUpdateDeleteTest(common.HeatTestCase): generic_rsrc.GenericResource) tpl = {'HeatTemplateFormatVersion': '2012-12-12', 'Resources': { - 'A': {'Type': 'GenericResourceType'}, - 'B': {'Type': 'GenericResourceType'}, - 'C': {'Type': 'GenericResourceType'}}} + 'A': {'Type': 'GenericResourceType'}, + 'B': {'Type': 'GenericResourceType'}, + 'C': {'Type': 'GenericResourceType'}}} template = templatem.Template(tpl) @@ -1209,9 +1209,9 @@ class StackServiceCreateUpdateDeleteTest(common.HeatTestCase): generic_rsrc.GenericResource) tpl = {'HeatTemplateFormatVersion': '2012-12-12', 'Resources': { - 'A': {'Type': 'GenericResourceType'}, - 'B': {'Type': 'GenericResourceType'}, - 'C': {'Type': 'GenericResourceType'}}} + 'A': {'Type': 'GenericResourceType'}, + 'B': {'Type': 'GenericResourceType'}, + 'C': {'Type': 'GenericResourceType'}}} template = templatem.Template(tpl) old_stack = parser.Stack(self.ctx, stack_name, template) diff --git a/heat/tests/test_identifier.py b/heat/tests/test_identifier.py index 60627d307..af0251d41 100644 --- a/heat/tests/test_identifier.py +++ b/heat/tests/test_identifier.py @@ -317,7 +317,7 @@ class IdentifierTest(testtools.TestCase): def test_arn_url_decode_escape_round_trip(self): enc_arn = "".join(['arn%3Aopenstack%3Aheat%3A%3A%253A%252F%3A', - 'stacks%2F%253A%2525%2F%253A%252F%2F%253A']) + 'stacks%2F%253A%2525%2F%253A%252F%2F%253A']) url = self.url_prefix + enc_arn hi = identifier.HeatIdentifier.from_arn_url(url) hi2 = identifier.HeatIdentifier.from_arn_url(self.url_prefix + diff --git a/heat/tests/test_notifications.py b/heat/tests/test_notifications.py index ba4da36c6..8b6e1f0fd 100644 --- a/heat/tests/test_notifications.py +++ b/heat/tests/test_notifications.py @@ -191,58 +191,60 @@ class ScaleNotificationTest(common.HeatTestCase): with_error=None): stack_arn = self.stack.identifier().arn() - expected = [mock.call(self.ctx, - 'orchestration.autoscaling.start', - {'state_reason': - 'Stack CREATE completed successfully', - 'user_id': 'test_username', - 'stack_identity': stack_arn, - 'tenant_id': 'test_tenant', - 'create_at': self.create_at, - 'adjustment_type': 'ChangeInCapacity', - 'groupname': group.FnGetRefId(), - 'capacity': start_capacity, - 'adjustment': adjust, - 'stack_name': self.stack_name, - 'message': 'Start resizing the group %s' % - group.FnGetRefId(), - 'state': 'CREATE_COMPLETE'}) - ] + expected = [mock.call( + self.ctx, + 'orchestration.autoscaling.start', + {'state_reason': 'Stack CREATE completed successfully', + 'user_id': 'test_username', + 'stack_identity': stack_arn, + 'tenant_id': 'test_tenant', + 'create_at': self.create_at, + 'adjustment_type': 'ChangeInCapacity', + 'groupname': group.FnGetRefId(), + 'capacity': start_capacity, + 'adjustment': adjust, + 'stack_name': self.stack_name, + 'message': 'Start resizing the group %s' % + group.FnGetRefId(), + 'state': 'CREATE_COMPLETE'}) + ] if with_error: - expected += [mock.call(self.ctx, - 'orchestration.autoscaling.error', - {'state_reason': - 'Stack CREATE completed successfully', - 'user_id': 'test_username', - 'stack_identity': stack_arn, - 'tenant_id': 'test_tenant', - 'create_at': self.create_at, - 'adjustment_type': 'ChangeInCapacity', - 'groupname': group.FnGetRefId(), - 'capacity': start_capacity, - 'adjustment': adjust, - 'stack_name': self.stack_name, - 'message': with_error, - 'state': 'CREATE_COMPLETE'}) - ] + expected += [mock.call( + self.ctx, + 'orchestration.autoscaling.error', + {'state_reason': + 'Stack CREATE completed successfully', + 'user_id': 'test_username', + 'stack_identity': stack_arn, + 'tenant_id': 'test_tenant', + 'create_at': self.create_at, + 'adjustment_type': 'ChangeInCapacity', + 'groupname': group.FnGetRefId(), + 'capacity': start_capacity, + 'adjustment': adjust, + 'stack_name': self.stack_name, + 'message': with_error, + 'state': 'CREATE_COMPLETE'}) + ] else: - expected += [mock.call(self.ctx, - 'orchestration.autoscaling.end', - {'state_reason': - 'Stack CREATE completed successfully', - 'user_id': 'test_username', - 'stack_identity': stack_arn, - 'tenant_id': 'test_tenant', - 'create_at': self.create_at, - 'adjustment_type': 'ChangeInCapacity', - 'groupname': group.FnGetRefId(), - 'capacity': end_capacity, - 'adjustment': adjust, - 'stack_name': self.stack_name, - 'message': 'End resizing the group %s' % - group.FnGetRefId(), - 'state': 'CREATE_COMPLETE'}) - ] + expected += [mock.call( + self.ctx, + 'orchestration.autoscaling.end', + {'state_reason': + 'Stack CREATE completed successfully', + 'user_id': 'test_username', + 'stack_identity': stack_arn, + 'tenant_id': 'test_tenant', + 'create_at': self.create_at, + 'adjustment_type': 'ChangeInCapacity', + 'groupname': group.FnGetRefId(), + 'capacity': end_capacity, + 'adjustment': adjust, + 'stack_name': self.stack_name, + 'message': 'End resizing the group %s' % + group.FnGetRefId(), + 'state': 'CREATE_COMPLETE'}) + ] return expected diff --git a/heat/tests/test_parser.py b/heat/tests/test_parser.py index b22b108d4..8b8e4f272 100644 --- a/heat/tests/test_parser.py +++ b/heat/tests/test_parser.py @@ -1210,9 +1210,9 @@ class StackTest(common.HeatTestCase): def test_set_param_id_update(self): tmpl = {'HeatTemplateFormatVersion': '2012-12-12', 'Resources': { - 'AResource': {'Type': 'ResourceWithPropsType', - 'Metadata': {'Bar': {'Ref': 'AWS::StackId'}}, - 'Properties': {'Foo': 'abc'}}}} + 'AResource': {'Type': 'ResourceWithPropsType', + 'Metadata': {'Bar': {'Ref': 'AWS::StackId'}}, + 'Properties': {'Foo': 'abc'}}}} self.stack = parser.Stack(self.ctx, 'update_stack_arn_test', template.Template(tmpl)) @@ -1225,9 +1225,10 @@ class StackTest(common.HeatTestCase): tmpl2 = {'HeatTemplateFormatVersion': '2012-12-12', 'Resources': { - 'AResource': {'Type': 'ResourceWithPropsType', - 'Metadata': {'Bar': {'Ref': 'AWS::StackId'}}, - 'Properties': {'Foo': 'xyz'}}}} + 'AResource': {'Type': 'ResourceWithPropsType', + 'Metadata': {'Bar': + {'Ref': 'AWS::StackId'}}, + 'Properties': {'Foo': 'xyz'}}}} updated_stack = parser.Stack(self.ctx, 'updated_stack', template.Template(tmpl2)) @@ -1327,13 +1328,12 @@ class StackTest(common.HeatTestCase): def test_access_policy_update(self): tmpl = {'HeatTemplateFormatVersion': '2012-12-12', 'Resources': { - 'R1': {'Type': 'GenericResourceType'}, - 'Policy': { - 'Type': 'OS::Heat::AccessPolicy', - 'Properties': { - 'AllowedResources': ['R1'], - }, - }}} + 'R1': {'Type': 'GenericResourceType'}, + 'Policy': { + 'Type': 'OS::Heat::AccessPolicy', + 'Properties': { + 'AllowedResources': ['R1'] + }}}} self.stack = parser.Stack(self.ctx, 'update_stack_access_policy_test', template.Template(tmpl)) @@ -1344,14 +1344,13 @@ class StackTest(common.HeatTestCase): tmpl2 = {'HeatTemplateFormatVersion': '2012-12-12', 'Resources': { - 'R1': {'Type': 'GenericResourceType'}, - 'R2': {'Type': 'GenericResourceType'}, - 'Policy': { - 'Type': 'OS::Heat::AccessPolicy', - 'Properties': { - 'AllowedResources': ['R1', 'R2'], - }, - }}} + 'R1': {'Type': 'GenericResourceType'}, + 'R2': {'Type': 'GenericResourceType'}, + 'Policy': { + 'Type': 'OS::Heat::AccessPolicy', + 'Properties': { + 'AllowedResources': ['R1', 'R2'], + }}}} updated_stack = parser.Stack(self.ctx, 'updated_stack', template.Template(tmpl2)) @@ -2074,8 +2073,8 @@ class StackTest(common.HeatTestCase): tmpl2 = {'HeatTemplateFormatVersion': '2012-12-12', 'Resources': { - 'AResource': {'Type': 'GenericResourceType'}, - 'BResource': {'Type': 'GenericResourceType'}}} + 'AResource': {'Type': 'GenericResourceType'}, + 'BResource': {'Type': 'GenericResourceType'}}} updated_stack = parser.Stack(self.ctx, 'updated_stack', template.Template(tmpl2)) self.stack.update(updated_stack) @@ -2086,8 +2085,8 @@ class StackTest(common.HeatTestCase): def test_update_remove(self): tmpl = {'HeatTemplateFormatVersion': '2012-12-12', 'Resources': { - 'AResource': {'Type': 'GenericResourceType'}, - 'BResource': {'Type': 'GenericResourceType'}}} + 'AResource': {'Type': 'GenericResourceType'}, + 'BResource': {'Type': 'GenericResourceType'}}} self.stack = parser.Stack(self.ctx, 'update_test_stack', template.Template(tmpl)) @@ -2689,8 +2688,8 @@ class StackTest(common.HeatTestCase): tmpl2 = {'HeatTemplateFormatVersion': '2012-12-12', 'Resources': { - 'AResource': {'Type': 'GenericResourceType'}, - 'BResource': {'Type': 'GenericResourceType'}}} + 'AResource': {'Type': 'GenericResourceType'}, + 'BResource': {'Type': 'GenericResourceType'}}} updated_stack = parser.Stack(self.ctx, 'updated_stack', template.Template(tmpl2)) @@ -2724,8 +2723,8 @@ class StackTest(common.HeatTestCase): tmpl2 = {'HeatTemplateFormatVersion': '2012-12-12', 'Resources': { - 'AResource': {'Type': 'GenericResourceType'}, - 'BResource': {'Type': 'GenericResourceType'}}} + 'AResource': {'Type': 'GenericResourceType'}, + 'BResource': {'Type': 'GenericResourceType'}}} updated_stack = parser.Stack(self.ctx, 'updated_stack', template.Template(tmpl2)) @@ -2758,8 +2757,8 @@ class StackTest(common.HeatTestCase): tmpl2 = {'HeatTemplateFormatVersion': '2012-12-12', 'Resources': { - 'AResource': {'Type': 'GenericResourceType'}, - 'BResource': {'Type': 'GenericResourceType'}}} + 'AResource': {'Type': 'GenericResourceType'}, + 'BResource': {'Type': 'GenericResourceType'}}} updated_stack = parser.Stack(self.ctx, 'updated_stack', template.Template(tmpl2), disable_rollback=False) @@ -2909,8 +2908,8 @@ class StackTest(common.HeatTestCase): tmpl2 = {'HeatTemplateFormatVersion': '2012-12-12', 'Resources': { - 'AResource': {'Type': 'GenericResourceType'}, - 'BResource': {'Type': 'GenericResourceType'}}} + 'AResource': {'Type': 'GenericResourceType'}, + 'BResource': {'Type': 'GenericResourceType'}}} updated_stack = parser.Stack(self.ctx, 'updated_stack', template.Template(tmpl2), @@ -2931,8 +2930,8 @@ class StackTest(common.HeatTestCase): def test_update_rollback_remove(self): tmpl = {'HeatTemplateFormatVersion': '2012-12-12', 'Resources': { - 'AResource': {'Type': 'GenericResourceType'}, - 'BResource': {'Type': 'ResourceWithPropsType'}}} + 'AResource': {'Type': 'GenericResourceType'}, + 'BResource': {'Type': 'ResourceWithPropsType'}}} self.stack = parser.Stack(self.ctx, 'update_test_stack', template.Template(tmpl), @@ -2970,8 +2969,8 @@ class StackTest(common.HeatTestCase): def test_update_rollback_replace(self): tmpl = {'HeatTemplateFormatVersion': '2012-12-12', 'Resources': { - 'AResource': {'Type': 'ResourceWithPropsType', - 'Properties': {'Foo': 'foo'}}}} + 'AResource': {'Type': 'ResourceWithPropsType', + 'Properties': {'Foo': 'foo'}}}} self.stack = parser.Stack(self.ctx, 'update_test_stack', template.Template(tmpl), @@ -3011,18 +3010,18 @@ class StackTest(common.HeatTestCase): ''' tmpl = {'HeatTemplateFormatVersion': '2012-12-12', 'Resources': { - 'AResource': {'Type': 'ResourceWithPropsType', - 'Properties': {'Foo': 'abc'}}, - 'BResource': {'Type': 'ResourceWithPropsType', - 'Properties': { - 'Foo': {'Ref': 'AResource'}}}}} + 'AResource': {'Type': 'ResourceWithPropsType', + 'Properties': {'Foo': 'abc'}}, + 'BResource': {'Type': 'ResourceWithPropsType', + 'Properties': { + 'Foo': {'Ref': 'AResource'}}}}} tmpl2 = {'HeatTemplateFormatVersion': '2012-12-12', 'Resources': { - 'AResource': {'Type': 'ResourceWithPropsType', - 'Properties': {'Foo': 'smelly'}}, - 'BResource': {'Type': 'ResourceWithPropsType', - 'Properties': { - 'Foo': {'Ref': 'AResource'}}}}} + 'AResource': {'Type': 'ResourceWithPropsType', + 'Properties': {'Foo': 'smelly'}}, + 'BResource': {'Type': 'ResourceWithPropsType', + 'Properties': { + 'Foo': {'Ref': 'AResource'}}}}} self.stack = parser.Stack(self.ctx, 'update_test_stack', template.Template(tmpl)) @@ -3059,17 +3058,17 @@ class StackTest(common.HeatTestCase): ''' tmpl = {'HeatTemplateFormatVersion': '2012-12-12', 'Resources': { - 'CResource': {'Type': 'ResourceWithPropsType', - 'Properties': {'Foo': 'abc'}}}} + 'CResource': {'Type': 'ResourceWithPropsType', + 'Properties': {'Foo': 'abc'}}}} tmpl2 = {'HeatTemplateFormatVersion': '2012-12-12', 'Resources': { - 'CResource': {'Type': 'ResourceWithPropsType', - 'Properties': {'Foo': 'abc'}}, - 'AResource': {'Type': 'ResourceWithPropsType', - 'Properties': {'Foo': 'smelly'}}, - 'BResource': {'Type': 'ResourceWithPropsType', - 'Properties': { - 'Foo': {'Ref': 'AResource'}}}}} + 'CResource': {'Type': 'ResourceWithPropsType', + 'Properties': {'Foo': 'abc'}}, + 'AResource': {'Type': 'ResourceWithPropsType', + 'Properties': {'Foo': 'smelly'}}, + 'BResource': {'Type': 'ResourceWithPropsType', + 'Properties': { + 'Foo': {'Ref': 'AResource'}}}}} self.stack = parser.Stack(self.ctx, 'update_test_stack', template.Template(tmpl)) @@ -3108,18 +3107,18 @@ class StackTest(common.HeatTestCase): ''' tmpl = {'HeatTemplateFormatVersion': '2012-12-12', 'Resources': { - 'AResource': {'Type': 'ResourceWithPropsType', - 'Properties': {'Foo': 'abc'}}, - 'BResource': {'Type': 'ResourceWithPropsType', - 'Properties': { - 'Foo': {'Ref': 'AResource'}}}}} + 'AResource': {'Type': 'ResourceWithPropsType', + 'Properties': {'Foo': 'abc'}}, + 'BResource': {'Type': 'ResourceWithPropsType', + 'Properties': { + 'Foo': {'Ref': 'AResource'}}}}} tmpl2 = {'HeatTemplateFormatVersion': '2012-12-12', 'Resources': { - 'AResource': {'Type': 'ResourceWithPropsType', - 'Properties': {'Foo': 'smelly'}}, - 'BResource': {'Type': 'ResourceWithPropsType', - 'Properties': { - 'Foo': {'Ref': 'AResource'}}}}} + 'AResource': {'Type': 'ResourceWithPropsType', + 'Properties': {'Foo': 'smelly'}}, + 'BResource': {'Type': 'ResourceWithPropsType', + 'Properties': { + 'Foo': {'Ref': 'AResource'}}}}} self.stack = parser.Stack(self.ctx, 'update_test_stack', template.Template(tmpl), @@ -3172,18 +3171,18 @@ class StackTest(common.HeatTestCase): tmpl = {'HeatTemplateFormatVersion': '2012-12-12', 'Resources': { - 'AResource': {'Type': 'ResourceTypeA', - 'Properties': {'Foo': 'abc'}}, - 'BResource': {'Type': 'ResourceWithPropsType', - 'Properties': { - 'Foo': {'Ref': 'AResource'}}}}} + 'AResource': {'Type': 'ResourceTypeA', + 'Properties': {'Foo': 'abc'}}, + 'BResource': {'Type': 'ResourceWithPropsType', + 'Properties': { + 'Foo': {'Ref': 'AResource'}}}}} tmpl2 = {'HeatTemplateFormatVersion': '2012-12-12', 'Resources': { - 'AResource': {'Type': 'ResourceTypeA', - 'Properties': {'Foo': 'smelly'}}, - 'BResource': {'Type': 'ResourceWithPropsType', - 'Properties': { - 'Foo': {'Ref': 'AResource'}}}}} + 'AResource': {'Type': 'ResourceTypeA', + 'Properties': {'Foo': 'smelly'}}, + 'BResource': {'Type': 'ResourceWithPropsType', + 'Properties': { + 'Foo': {'Ref': 'AResource'}}}}} self.stack = parser.Stack(self.ctx, 'update_test_stack', template.Template(tmpl), @@ -3238,18 +3237,18 @@ class StackTest(common.HeatTestCase): tmpl = {'HeatTemplateFormatVersion': '2012-12-12', 'Resources': { - 'AResource': {'Type': 'ResourceTypeA', - 'Properties': {'Foo': 'abc'}}, - 'BResource': {'Type': 'ResourceWithPropsType', - 'Properties': { - 'Foo': {'Ref': 'AResource'}}}}} + 'AResource': {'Type': 'ResourceTypeA', + 'Properties': {'Foo': 'abc'}}, + 'BResource': {'Type': 'ResourceWithPropsType', + 'Properties': { + 'Foo': {'Ref': 'AResource'}}}}} tmpl2 = {'HeatTemplateFormatVersion': '2012-12-12', 'Resources': { - 'AResource': {'Type': 'ResourceTypeA', - 'Properties': {'Foo': 'smelly'}}, - 'BResource': {'Type': 'ResourceWithPropsType', - 'Properties': { - 'Foo': {'Ref': 'AResource'}}}}} + 'AResource': {'Type': 'ResourceTypeA', + 'Properties': {'Foo': 'smelly'}}, + 'BResource': {'Type': 'ResourceWithPropsType', + 'Properties': { + 'Foo': {'Ref': 'AResource'}}}}} self.stack = parser.Stack(self.ctx, 'update_test_stack', template.Template(tmpl), @@ -3420,11 +3419,11 @@ class StackTest(common.HeatTestCase): tmpl = {'HeatTemplateFormatVersion': '2012-12-12', 'Resources': { - 'AResource': {'Type': 'ResourceTypeA', - 'Properties': {'Foo': 'abc'}}, - 'BResource': {'Type': 'ResourceWithPropsType', - 'Properties': { - 'Foo': {'Ref': 'AResource'}}}}} + 'AResource': {'Type': 'ResourceTypeA', + 'Properties': {'Foo': 'abc'}}, + 'BResource': {'Type': 'ResourceWithPropsType', + 'Properties': { + 'Foo': {'Ref': 'AResource'}}}}} self.stack = parser.Stack(self.ctx, 'update_test_stack', template.Template(tmpl), disable_rollback=True) @@ -3496,8 +3495,8 @@ class StackTest(common.HeatTestCase): def test_update_deletion_policy(self): tmpl = {'HeatTemplateFormatVersion': '2012-12-12', 'Resources': { - 'AResource': {'Type': 'ResourceWithPropsType', - 'Properties': {'Foo': 'Bar'}}}} + 'AResource': {'Type': 'ResourceWithPropsType', + 'Properties': {'Foo': 'Bar'}}}} self.stack = parser.Stack(self.ctx, 'update_test_stack', template.Template(tmpl)) @@ -3510,9 +3509,9 @@ class StackTest(common.HeatTestCase): new_tmpl = {'HeatTemplateFormatVersion': '2012-12-12', 'Resources': { - 'AResource': {'Type': 'ResourceWithPropsType', - 'DeletionPolicy': 'Retain', - 'Properties': {'Foo': 'Bar'}}}} + 'AResource': {'Type': 'ResourceWithPropsType', + 'DeletionPolicy': 'Retain', + 'Properties': {'Foo': 'Bar'}}}} updated_stack = parser.Stack(self.ctx, 'updated_stack', template.Template(new_tmpl)) @@ -3532,8 +3531,8 @@ class StackTest(common.HeatTestCase): tmpl = {'HeatTemplateFormatVersion': '2012-12-12', 'Resources': { - 'AResource': {'Type': 'ResourceWithNoUpdate', - 'Properties': {'Foo': 'Bar'}}}} + 'AResource': {'Type': 'ResourceWithNoUpdate', + 'Properties': {'Foo': 'Bar'}}}} self.stack = parser.Stack(self.ctx, 'update_test_stack', template.Template(tmpl)) @@ -3546,9 +3545,9 @@ class StackTest(common.HeatTestCase): new_tmpl = {'HeatTemplateFormatVersion': '2012-12-12', 'Resources': { - 'AResource': {'Type': 'ResourceWithNoUpdate', - 'DeletionPolicy': 'Retain', - 'Properties': {'Foo': 'Bar'}}}} + 'AResource': {'Type': 'ResourceWithNoUpdate', + 'DeletionPolicy': 'Retain', + 'Properties': {'Foo': 'Bar'}}}} updated_stack = parser.Stack(self.ctx, 'updated_stack', template.Template(new_tmpl)) @@ -4119,10 +4118,10 @@ class StackTest(common.HeatTestCase): def test_correct_outputs(self): tmpl = {'HeatTemplateFormatVersion': '2012-12-12', 'Resources': { - 'AResource': {'Type': 'ResourceWithPropsType', - 'Properties': {'Foo': 'abc'}}, - 'BResource': {'Type': 'ResourceWithPropsType', - 'Properties': {'Foo': 'def'}}}, + 'AResource': {'Type': 'ResourceWithPropsType', + 'Properties': {'Foo': 'abc'}}, + 'BResource': {'Type': 'ResourceWithPropsType', + 'Properties': {'Foo': 'def'}}}, 'Outputs': { 'Resource_attr': { 'Value': { @@ -4149,8 +4148,8 @@ class StackTest(common.HeatTestCase): def test_incorrect_outputs(self): tmpl = {'HeatTemplateFormatVersion': '2012-12-12', 'Resources': { - 'AResource': {'Type': 'ResourceWithPropsType', - 'Properties': {'Foo': 'abc'}}}, + 'AResource': {'Type': 'ResourceWithPropsType', + 'Properties': {'Foo': 'abc'}}}, 'Outputs': { 'Resource_attr': { 'Value': { @@ -4251,8 +4250,8 @@ class StackTest(common.HeatTestCase): def test_incorrect_outputs_cfn_get_attr(self): tmpl = {'HeatTemplateFormatVersion': '2012-12-12', 'Resources': { - 'AResource': {'Type': 'ResourceWithPropsType', - 'Properties': {'Foo': 'abc'}}}, + 'AResource': {'Type': 'ResourceWithPropsType', + 'Properties': {'Foo': 'abc'}}}, 'Outputs': { 'Resource_attr': { 'Value': { @@ -4369,8 +4368,8 @@ class StackTest(common.HeatTestCase): def test_incorrect_outputs_hot_get_attr(self): tmpl = {'heat_template_version': '2013-05-23', 'resources': { - 'AResource': {'type': 'ResourceWithPropsType', - 'properties': {'Foo': 'abc'}}}, + 'AResource': {'type': 'ResourceWithPropsType', + 'properties': {'Foo': 'abc'}}}, 'outputs': { 'resource_attr': { 'value': { @@ -4389,8 +4388,8 @@ class StackTest(common.HeatTestCase): def test_restore(self): tmpl = {'HeatTemplateFormatVersion': '2012-12-12', 'Resources': { - 'A': {'Type': 'GenericResourceType'}, - 'B': {'Type': 'GenericResourceType'}}} + 'A': {'Type': 'GenericResourceType'}, + 'B': {'Type': 'GenericResourceType'}}} self.stack = parser.Stack(self.ctx, 'stack_details_test', parser.Template(tmpl)) self.stack.store() diff --git a/heat/tests/test_resource_group.py b/heat/tests/test_resource_group.py index 8f0f74f78..4acc35e7e 100644 --- a/heat/tests/test_resource_group.py +++ b/heat/tests/test_resource_group.py @@ -487,7 +487,7 @@ class ResourceGroupTest(common.HeatTestCase): reduce_snip = copy.deepcopy(resg.t) reduce_snip['Properties']['count'] = 2 reduce_snip['Properties']['removal_policies'] = [{'resource_list': - ['1', '2', '3']}] + ['1', '2', '3']}] scheduler.TaskRunner(resg.update, reduce_snip)() self.assertEqual((resg.UPDATE, resg.COMPLETE), resg.state) self.assertEqual((resg.UPDATE, resg.COMPLETE), resg.nested().state) @@ -588,7 +588,7 @@ class ResourceGroupTest(common.HeatTestCase): reduce_snip = copy.deepcopy(resg.t) reduce_snip['Properties']['count'] = 2 reduce_snip['Properties']['removal_policies'] = [{'resource_list': - ['1', '2', '3']}] + ['1', '2', '3']}] scheduler.TaskRunner(resg.update, reduce_snip)() self.assertEqual((resg.UPDATE, resg.COMPLETE), resg.state) self.assertEqual((resg.UPDATE, resg.COMPLETE), resg.nested().state) diff --git a/heat/tests/test_server.py b/heat/tests/test_server.py index 4862322f3..c2098e3f2 100644 --- a/heat/tests/test_server.py +++ b/heat/tests/test_server.py @@ -1841,8 +1841,7 @@ class ServersTest(common.HeatTestCase): self.assertEqual([{'net-id': 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa'}], server._build_nics( [{'network': - 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa'}] - )) + 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa'}])) self.assertEqual([{'net-id': 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa'}], server._build_nics([{'network': 'public'}])) diff --git a/heat/tests/test_software_component.py b/heat/tests/test_software_component.py index 1b6d072cf..b1c18b791 100644 --- a/heat/tests/test_software_component.py +++ b/heat/tests/test_software_component.py @@ -170,18 +170,18 @@ class SoftwareComponentValidationTest(common.HeatTestCase): err_msg='Property configs not assigned') ), # do not test until bug #1350840 -# ( -# 'empty_configs', -# dict(snippet=''' -# component: -# type: OS::Heat::SoftwareComponent -# properties: -# configs: -# ''', -# err=exception.StackValidationFailed, -# err_msg='configs length (0) is out of range ' -# '(min: 1, max: None)') -# ), + #( + # 'empty_configs', + # dict(snippet=''' + # component: + # type: OS::Heat::SoftwareComponent + # properties: + # configs: + # ''', + # err=exception.StackValidationFailed, + # err_msg='configs length (0) is out of range ' + # '(min: 1, max: None)') + #), ( 'invalid_configs', dict(snippet=''' diff --git a/heat/tests/test_structured_config.py b/heat/tests/test_structured_config.py index 7d8f5389e..64616a908 100644 --- a/heat/tests/test_structured_config.py +++ b/heat/tests/test_structured_config.py @@ -203,8 +203,8 @@ class StructuredDeploymentWithStrictInputTest(common.HeatTestCase): def setUp(self): super(StructuredDeploymentWithStrictInputTest, self).setUp() self.source = {'config': - {'foo': [{"get_input": "bar"}, - {"get_input": "barz"}]}} + {'foo': [{"get_input": "bar"}, + {"get_input": "barz"}]}} self.inputs = [{'name': 'bar', 'value': 'baz'}, {'name': 'barz', 'value': 'baz2'}] diff --git a/heat/tests/v1_1/fakes.py b/heat/tests/v1_1/fakes.py index 0114aee44..94d7a7118 100644 --- a/heat/tests/v1_1/fakes.py +++ b/heat/tests/v1_1/fakes.py @@ -128,8 +128,8 @@ class FakeHTTPClient(base_client.HTTPClient): "fa:16:3e:8c:33:bb"}], "private": [{"version": 4, "addr": "10.13.12.13", - "OS-EXT-IPS-MAC:mac_addr": - "fa:16:3e:8c:44:cc"}]}, + "OS-EXT-IPS-MAC:mac_addr": + "fa:16:3e:8c:44:cc"}]}, "metadata": {}}, {"id": "9101", "name": "hard-reboot", diff --git a/tox.ini b/tox.ini index 849471afe..9ab8ee480 100644 --- a/tox.ini +++ b/tox.ini @@ -53,9 +53,6 @@ commands = bash tools/config/generate_sample.sh -b . -p heat -o etc/heat [flake8] -# E122 continuation line missing indentation or outdented -# E126 continuation line over-indented for hanging indent -# E128 continuation line under-indented for visual indent # E251 unexpected spaces around keyword / parameter equals # E265 block comment should start with '# ' # F402 import shadowed by loop variable @@ -70,7 +67,7 @@ commands = # H405 multi line docstring summary not separated with an empty line # H803 no full stop at the end of the commit message # H904 Wrap long lines in parentheses instead of a backslash -ignore = E122,E126,E128,E251,E265,F402,F812,H101,H202,H233,H305,H307,H402,H404,H405,H803,H904 +ignore = E251,E265,F402,F812,H101,H202,H233,H305,H307,H402,H404,H405,H803,H904 show-source = true exclude=.venv,.git,.tox,dist,*openstack/common*,*lib/python*,*egg,tools,build max-complexity=20