Project

Profile

Help

Issue #9250

improper validation when passing json as requirements yaml

Added by jsherril@redhat.com 2 months ago. Updated 2 months ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Assignee:
Sprint/Milestone:
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

Associated revisions

Revision c7e4276f View on GitHub
Added by Fabricio Aguiar 2 months ago

Improve validation when parsing requirements.yml

closes #9250

Revision 3624c822 View on GitHub
Added by Fabricio Aguiar 2 months ago

Improve validation when parsing requirements.yml

closes #9250

(cherry picked from commit c7e4276ff9244b3e7526e374f95907360e5a8e6c)

History

#1 Updated by fao89 2 months ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to fao89

#2 Updated by pulpbot 2 months ago

  • Status changed from ASSIGNED to POST

#3 Updated by Anonymous 2 months ago

  • Status changed from POST to MODIFIED

#5 Updated by fao89 2 months ago

  • Sprint/Milestone set to 0.9.1

#6 Updated by pulpbot 2 months ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE

Please register to edit this issue

Also available in: Atom PDF