Actions
Issue #9250
closedimproper validation when passing json as requirements yaml
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Platform Release:
OS:
Triaged:
No
Groomed:
No
Sprint Candidate:
No
Tags:
Katello
Sprint:
Quarter:
Description
Json seems to be a subset of yaml in some cases and with some libraries. Pulp's parsing seems to allow it as something like this:
{"collections": "theforeman.foreman"}
works fine as a requirements.yaml on a remote. However when you sync, you get a traceback:
{"traceback"=>
" File \"/usr/lib/python3.6/site-packages/pulpcore/tasking/pulpcore_worker.py\", line 272, in _perform_task\n" +
" result = func(*args, **kwargs)\n" +
" File \"/usr/local/lib/python3.6/site-packages/pulp_ansible/app/tasks/collections.py\", line 130, in sync\n" +
" repo_version = d_version.create()\n" +
" File \"/usr/lib/python3.6/site-packages/pulpcore/plugin/stages/declarative_version.py\", line 151, in create\n" +
" loop.run_until_complete(pipeline)\n" +
" File \"/usr/lib64/python3.6/asyncio/base_events.py\", line 484, in run_until_complete\n" +
" return future.result()\n" +
" File \"/usr/lib/python3.6/site-packages/pulpcore/plugin/stages/api.py\", line 225, in create_pipeline\n" +
" await asyncio.gather(*futures)\n" +
" File \"/usr/lib/python3.6/site-packages/pulpcore/plugin/stages/api.py\", line 43, in __call__\n" +
" await self.run()\n" +
" File \"/usr/local/lib/python3.6/site-packages/pulp_ansible/app/tasks/collections.py\", line 778, in run\n" +
" await asyncio.gather(*tasks)\n" +
" File \"/usr/local/lib/python3.6/site-packages/pulp_ansible/app/tasks/collections.py\", line 587, in _fetch_collection_metadata\n" +
" namespace, name = requirements_entry.name.split(\".\")\n",
"description"=>"not enough values to unpack (expected 2, got 1)"},
So it seems like that format should either error on save (like other invalid yaml does), or work for syncing
Actions
Improve validation when parsing requirements.yml
closes #9250