From 390883c17d81f3b670ff0fe97cdb3ce0e613580e Mon Sep 17 00:00:00 2001 From: Tony Breeds Date: Fri, 15 Nov 2019 10:21:32 +1100 Subject: [PATCH] Add simple liaisons wrapper module I'm going to want to use this in a later change so lets make the abstraction now Change-Id: I0d15b5137d857bffb2bed39e995e50fed24f5598 --- openstack_releases/cmds/list_changes.py | 5 ++--- openstack_releases/liaisons.py | 23 +++++++++++++++++++++++ 2 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 openstack_releases/liaisons.py diff --git a/openstack_releases/cmds/list_changes.py b/openstack_releases/cmds/list_changes.py index 70956a961a..d3f1015a75 100644 --- a/openstack_releases/cmds/list_changes.py +++ b/openstack_releases/cmds/list_changes.py @@ -29,7 +29,6 @@ import shutil import subprocess import sys import tempfile -import yaml from openstack_governance import governance import pyfiglet @@ -39,6 +38,7 @@ from openstack_releases import defaults from openstack_releases import deliverable from openstack_releases import gitutils from openstack_releases import hound +from openstack_releases import liaisons from openstack_releases import release_notes from openstack_releases import yamlutils @@ -260,8 +260,7 @@ def main(): False, ) - with open("./data/release_liaisons.yaml", "r") as f: - liaison_data = yaml.safe_load(f) + liaison_data = liaisons.get_liaisons() # Remove any inherited PAGER environment variable to avoid # blocking the output waiting for input. diff --git a/openstack_releases/liaisons.py b/openstack_releases/liaisons.py new file mode 100644 index 0000000000..673698d571 --- /dev/null +++ b/openstack_releases/liaisons.py @@ -0,0 +1,23 @@ +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +"""Simple wrapper(s) around liaison data""" + +import yaml + + +def get_liaisons(): + with open("./data/release_liaisons.yaml", "r") as f: + liaison_data = yaml.safe_load(f) + return liaison_data