Merge "Dynamically find releases for move-implemented-specs"

This commit is contained in:
Zuul 2018-10-23 22:09:51 +00:00 committed by Gerrit Code Review
commit 5ef210d863
1 changed files with 11 additions and 8 deletions

View File

@ -23,6 +23,16 @@ from launchpadlib import launchpad
LPCACHEDIR = os.path.expanduser('~/.launchpadlib/cache')
def get_choices():
# 3-tuple (dirpath, dirnames, filenames)
for _, choices, _ in os.walk('specs'):
choices.remove('backlog')
choices.sort()
# Quit walking (release dirs are at the first level in 'specs')
break
return choices
def get_options():
parser = argparse.ArgumentParser(
description='Move implemented specs for a given release. Requires '
@ -33,14 +43,7 @@ def get_options():
help='Do everything except move the files.',
action='store_true')
parser.add_argument('release', help='The release to process.',
choices=['juno',
'kilo',
'liberty',
'mitaka',
'newton',
'ocata',
'pike',
'queens'])
choices=get_choices())
return parser.parse_args()