Project

Profile

Help

Issue #9250

closed

improper validation when passing json as requirements yaml

Added by jsherril@redhat.com over 2 years ago. Updated over 2 years 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

Actions #1

Updated by fao89 over 2 years ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to fao89
Actions #2

Updated by pulpbot over 2 years ago

  • Status changed from ASSIGNED to POST

Added by Fabricio Aguiar over 2 years ago

Revision c7e4276f | View on GitHub

Improve validation when parsing requirements.yml

closes #9250

Actions #3

Updated by Anonymous over 2 years ago

  • Status changed from POST to MODIFIED

Added by Fabricio Aguiar over 2 years ago

Revision 3624c822 | View on GitHub

Improve validation when parsing requirements.yml

closes #9250

(cherry picked from commit c7e4276ff9244b3e7526e374f95907360e5a8e6c)

Actions #5

Updated by fao89 over 2 years ago

  • Sprint/Milestone set to 0.9.1
Actions #6

Updated by pulpbot over 2 years ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE

Also available in: Atom PDF