diff --git a/heat/engine/clients/os/swift.py b/heat/engine/clients/os/swift.py index 8919c84ac6..4dd59726b4 100644 --- a/heat/engine/clients/os/swift.py +++ b/heat/engine/clients/os/swift.py @@ -166,7 +166,10 @@ class SwiftClientPlugin(client_plugin.ClientPlugin): file_name = obj['name'] if file_name not in files_to_skip: contents = client.get_object(files_container, file_name)[1] - files[file_name] = contents + if isinstance(contents, bytes): + files[file_name] = contents.decode(encoding='utf-8') + else: + files[file_name] = contents except exceptions.ClientException as cex: raise exception.NotFound(_('Could not fetch files from ' 'container %(container)s, ' diff --git a/releasenotes/notes/heat-decode-files-read-from-containers-fe2bbb0b48a69717.yaml b/releasenotes/notes/heat-decode-files-read-from-containers-fe2bbb0b48a69717.yaml new file mode 100644 index 0000000000..45c8a893cb --- /dev/null +++ b/releasenotes/notes/heat-decode-files-read-from-containers-fe2bbb0b48a69717.yaml @@ -0,0 +1,7 @@ +--- +fixes: + - | + Fixed the consistent type mismatch error caused by creating or updating + a stack with files stored in OpenStack Swift containers, using + the `files_container` parameter. Now file content is always decoded and + can be used as a string value.