Add the ability to read --project-list file from local path
The import-goal --project-list option currently only supports URLs but the requests library doesn't support the file:// protocol: https://github.com/requests/requests/issues/2732 This change adds the ability to read a file path for --project-list instead of rely on URL in case you have a locally modified projects.yaml. Change-Id: I584534fb32f42e5d78941637285623ad96cf79c3 Story: 2003653 Task: 26066
This commit is contained in:
parent
6e3846682a
commit
fd54f1d2c4
@ -58,6 +58,10 @@ def _get_worklist_settings(tag):
|
||||
|
||||
|
||||
def _get_project_info(url):
|
||||
# First check to see if it's a local path we can read.
|
||||
if os.path.isfile(url):
|
||||
with open(url) as f:
|
||||
return yaml.safe_load(f)
|
||||
response = requests.get(url)
|
||||
data = yaml.safe_load(response.text)
|
||||
return data
|
||||
@ -99,7 +103,8 @@ def main():
|
||||
parser.add_argument(
|
||||
'--project-list',
|
||||
default='http://git.openstack.org/cgit/openstack/governance/plain/reference/projects.yaml', # noqa
|
||||
help='URL for governance projects list (%(default)s)',
|
||||
help='URL or file path for governance projects.yaml list '
|
||||
'(%(default)s)',
|
||||
)
|
||||
group = parser.add_mutually_exclusive_group()
|
||||
group.add_argument(
|
||||
|
Loading…
Reference in New Issue
Block a user