This is an automated email from the ASF dual-hosted git repository. mxmrlv pushed a commit to branch ARIA-422-Parsing-CSARs-is-broken in repository https://gitbox.apache.org/repos/asf/incubator-ariatosca.git
commit ca1f1d58bcc9b88d9faff722c5bb473621f3997c Author: max-orlov <[email protected]> AuthorDate: Mon Dec 4 16:10:25 2017 +0200 ARIA-422 Parsing CSARs is broken --- aria/cli/csar.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/aria/cli/csar.py b/aria/cli/csar.py index ba80bad..006bc6b 100644 --- a/aria/cli/csar.py +++ b/aria/cli/csar.py @@ -75,7 +75,7 @@ def write(service_template_path, destination, logger): logger.debug('Writing to archive: {0}'.format(file_relative_path)) f.write(file_full_path, file_relative_path) logger.debug('Writing new metadata file to {0}'.format(META_FILE)) - f.writestr(META_FILE, yaml.dump(metadata, default_flow_style=False)) + f.writestr(META_FILE, yaml.dump(metadata, default_flow_style=False, encoding='utf-8')) class _CSARReader(object): @@ -143,6 +143,8 @@ class _CSARReader(object): raise ValueError('Metadata file {0} is missing from the CSAR'.format(csar_metafile)) self.logger.debug('CSAR metadata file: {0}'.format(csar_metafile)) self.logger.debug('Attempting to parse CSAR metadata YAML') + + yaml.SafeLoader.add_constructor("tag:yaml.org,2002:python/unicode", lambda _, node: node.value) with open(csar_metafile) as f: self.metadata.update(yaml.load(f, Loader=yaml.SafeLoader)) self.logger.debug('CSAR metadata:{0}{1}'.format(os.linesep, pprint.pformat(self.metadata))) -- To stop receiving notification emails like this one, please contact "[email protected]" <[email protected]>.
