From a4065c51b4564a2b135167b7afb1f938c678fae4 Mon Sep 17 00:00:00 2001 From: Pierce Cohen Date: Sun, 19 May 2024 19:57:43 -0500 Subject: [PATCH] Bug fixes for tags - Prevent generation_date tag format from being modified when SAVE_DATE_FORMAT is specified - Prevent NoneType from ending up in the tags (previous fix did not work) --- installer/client/cli/save.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/installer/client/cli/save.py b/installer/client/cli/save.py index 364e604..611cdc5 100755 --- a/installer/client/cli/save.py +++ b/installer/client/cli/save.py @@ -54,12 +54,12 @@ def main(tag, tags, silent, fabric): # Prevent a NoneType ending up in the tags frontmatter_tags = "" if fabric: - frontmatter_tags = os.getenv(FM_KEY) + frontmatter_tags = os.getenv(FM_KEY) or "" with open(target, "w") as fp: if frontmatter_tags or len(tags) != 0: fp.write("---\n") - now = datetime.now().strftime(f"{DATE_FORMAT} %H:%M") + now = datetime.now().strftime(f"%Y-%m-%d %H:%M") fp.write(f"generation_date: {now}\n") fp.write(f"tags: {frontmatter_tags} {tag} {' '.join(tags)}\n") fp.write("---\n")