Package: heat / 1:11.0.0-6

Fix_errors_with_issubclass_in_Python_3.7.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
Description: Fix errors with issubclass() in Python 3.7
 The cfn Ref instrinsic function is implemented as a Python function
 rather than a class, so calling issubclass() on it fails in Python 3.7.
Author: Zane Bitter <zbitter@redhat.com>
Date: Thu, 2 Aug 2018 10:55:43 -0400
Change-Id: I3f826cd8f024b591d7c3b41ad1e3f960558d3f9b
Origin: upstream, https://review.openstack.org/#/c/588307/
Last-Update: 2018-08-30

diff --git a/heat/engine/template.py b/heat/engine/template.py
index 5f70656..83d3d6f 100644
--- a/heat/engine/template.py
+++ b/heat/engine/template.py
@@ -366,7 +366,8 @@ def parse(functions, stack, snippet, path='', template=None):
             if Func is not None:
                 try:
                     path = '.'.join([path, fn_name])
-                    if issubclass(Func, function.Macro):
+                    if (isinstance(Func, type) and
+                            issubclass(Func, function.Macro)):
                         return Func(stack, fn_name, args,
                                     functools.partial(recurse, path=path),
                                     template)
-- 
cgit v1.1