Merge "Refactor confusing code in custom_guidelines.py"
This commit is contained in:
commit
6ddb9826e9
@ -33,15 +33,15 @@ class HeatCustomGuidelines(object):
|
|||||||
global_env = resources.global_env()
|
global_env = resources.global_env()
|
||||||
for resource_type in global_env.get_types():
|
for resource_type in global_env.get_types():
|
||||||
cls = global_env.get_class(resource_type)
|
cls = global_env.get_class(resource_type)
|
||||||
|
module = cls.__module__
|
||||||
# Skip resources, which defined as template resource in environment
|
# Skip resources, which defined as template resource in environment
|
||||||
if cls.__module__ == 'heat.engine.resources.template_resource':
|
if module == 'heat.engine.resources.template_resource':
|
||||||
continue
|
continue
|
||||||
# Skip discovered plugin resources
|
# Skip discovered plugin resources
|
||||||
if cls.__module__ == 'heat.engine.plugins':
|
if module == 'heat.engine.plugins':
|
||||||
continue
|
continue
|
||||||
if (lambda module: True
|
path = module.replace('.', '/')
|
||||||
if [path for path in exclude if path in module]
|
if any(path.startswith(excl_path) for excl_path in exclude):
|
||||||
else False)(cls.__module__.replace('.', '/')):
|
|
||||||
continue
|
continue
|
||||||
self.resources_classes.append(cls)
|
self.resources_classes.append(cls)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user