Add list_oslo_projects script

Copy from oslo-incubator and adjust to fit new file format of
governance/reference/projects.yaml

Change-Id: I1ad46885d7ccbad987a2563d7976f7153c6093fc
This commit is contained in:
ChangBo Guo(gcb) 2017-05-07 07:58:15 +08:00
parent e42436ae2f
commit ae65f2ae0a
1 changed files with 46 additions and 0 deletions

46
list_oslo_projects.py Executable file
View File

@ -0,0 +1,46 @@
#!/usr/bin/env python
# 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.
"""Print a list of the oslo project repository names.
"""
from __future__ import print_function
import os
import oslo_tool_config as cfg
import yaml
def main():
conf = cfg.get_config_parser()
cfg.parse_arguments(conf)
gov_repo = os.path.expanduser(os.path.join(conf.repo_root,
'governance'))
project_input = os.path.join(gov_repo, 'reference/projects.yaml')
with open(project_input, 'r') as f:
project = yaml.load(f.read())
repos = []
for v in project['oslo']['deliverables'].values():
repos.append(v['repos'][0])
for r in sorted(repos):
print(r)
if __name__ == '__main__':
import sys
sys.exit(main())