From af0903a916a4a4f4a17177c6ae0b1135997033d4 Mon Sep 17 00:00:00 2001 From: Sergey Kraynev Date: Wed, 2 Mar 2016 06:37:19 -0500 Subject: [PATCH] Ignore template res types during guideline checks Global environment during registering resources also load resources from /etc/environment.d . As result it loads two resources mapped on templates: - 'AWS::CloudWatch::Alarm' - 'AWS::RDS::DBInstance' However execute guideline checks for these resources is not possible due to these resources use template_resource object and can not be processed as usual *.py file. This patch add ignoring for these two resource types. Note: this error is not displayed on pep8 gate job due to we don't install devstack during execution this job, but this error affects all environments with installed devstack. Closes-Bug: #1552194 Change-Id: I29abdfa1a4f4a17dfbcdaaf6f0c6665359bab17a --- tools/custom_guidelines.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/custom_guidelines.py b/tools/custom_guidelines.py index 1d9baed888..1617c2bfa8 100644 --- a/tools/custom_guidelines.py +++ b/tools/custom_guidelines.py @@ -33,6 +33,9 @@ class HeatCustomGuidelines(object): global_env = resources.global_env() for resource_type in global_env.get_types(): cls = global_env.get_class(resource_type) + # Skip resources, which defined as template resource in environment + if cls.__module__ == 'heat.engine.resources.template_resource': + continue if (lambda module: True if [path for path in exclude if path in module] else False)(cls.__module__.replace('.', '/')):