From 318fcbde221ae49bfa98b2032aca14c88625ba78 Mon Sep 17 00:00:00 2001 From: Tony Breeds Date: Mon, 3 Jul 2023 20:59:35 +1000 Subject: [PATCH] Update list_weeks to use the release yamlutils It's a little more verbose but this is essentially the same as running format-yaml over the generated file. While this isn't "needed" it isn't a functional change and makes it easier to write a tool for the elections repo to generate changes like: https://review.opendev.org/q/I954afb4aad4286a8a6641ef8800541a8822a38f2 Change-Id: Iae5a79e362ea30396c70708a48005b44ec67fd62 --- tools/list_weeks.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tools/list_weeks.py b/tools/list_weeks.py index 6bac6e74f7..3aae2f80f2 100755 --- a/tools/list_weeks.py +++ b/tools/list_weeks.py @@ -15,7 +15,7 @@ import argparse import datetime -import yaml +from openstack_releases import yamlutils def mk_entry(name, week, cross_project=None, project_specific=None): @@ -84,10 +84,9 @@ for n, w in enumerate(weeks, 1): cycle.append(mk_entry(name, w, cross_project=cross_project)) data = { + 'start-week': '{:%Y-%m-%d}'.format(weeks[0]), + 'release-week': '{:%Y-%m-%d}'.format(next_release_date), 'cycle': cycle, } -print('---') -print('start-week: {:%Y-%m-%d}'.format(weeks[0])) -print('release-week: {:%Y-%m-%d}'.format(next_release_date)) -print(yaml.dump(data, default_flow_style=False, explicit_start=False)) +print(yamlutils.dumps(data))