From 2d938b6cb7bb5e3dbc6e2eb87e63b199a2885a9d Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Thu, 7 Nov 2019 09:10:20 +0100 Subject: [PATCH] fix author overwrite and template --- ansibledoctor/DocumentationParser.py | 6 ++++-- ansibledoctor/templates/readme/_meta.j2 | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ansibledoctor/DocumentationParser.py b/ansibledoctor/DocumentationParser.py index 01fd252..569f718 100644 --- a/ansibledoctor/DocumentationParser.py +++ b/ansibledoctor/DocumentationParser.py @@ -54,11 +54,12 @@ class Parser: if data.get("dependencies") is not None: self._data["meta"]["dependencies"] = {"value": data.get("dependencies")} - self._data["meta"]["name"] = {"value": os.path.basename(self.config.role_dir)} + + self._data["meta"]["name"] = {"value": os.path.basename(self.config.role_dir)} except (ruamel.yaml.composer.ComposerError, ruamel.yaml.scanner.ScannerError) as e: message = "{} {}".format(e.context, e.problem) self.log.sysexit_with_message("Unable to read yaml file {}\n{}".format(rfile, message)) - + print(self._data["meta"]) def _parse_task_tags(self): for rfile in self._files_registry.get_files(): if any(fnmatch.fnmatch(rfile, "*/tasks/*." + ext) for ext in YAML_EXTENSIONS): @@ -83,6 +84,7 @@ class Parser: try: anyconfig.merge(self._data, tags, ac_merge=anyconfig.MS_DICTS) + print(self._data) except ValueError as e: self.log.sysexit_with_message("Unable to merge annotation values:\n{}".format(e)) diff --git a/ansibledoctor/templates/readme/_meta.j2 b/ansibledoctor/templates/readme/_meta.j2 index 43092f2..3dee21a 100644 --- a/ansibledoctor/templates/readme/_meta.j2 +++ b/ansibledoctor/templates/readme/_meta.j2 @@ -19,6 +19,6 @@ None. ## Author -{{ meta.author.value }} +{{ meta.author.value | save_join(" ") }} {% endif %} {% endif %}