Bug 1127861

Summary: Updating a yum importer behaves differently than updating a yum distributor
Product: [Retired] Pulp Reporter: Jeremy Cline <jcline>
Component: rpm-supportAssignee: pulp-bugs
Status: CLOSED UPSTREAM QA Contact: pulp-qe-list
Severity: unspecified Docs Contact:
Priority: medium    
Version: MasterCC: skarmark
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-02-28 22:14:47 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description Jeremy Cline 2014-08-07 17:32:16 UTC
Description of problem: When I pass nonsense keys to the yum importer, it happily takes them. When I do the same thing to the distributor, it results in a traceback.

Version-Release number of selected component (if applicable): master

How reproducible: always

Steps to Reproduce:
1. Create a test repository: pulp-admin rpm repo create --repo-id zoo --feed https://repos.fedorapeople.org/repos/pulp/pulp/demo_repos/zoo/

2. Update the distributor: curl -i -H "Accept: application/json" -X PUT -d '{ "distributor_config": {"NOTAKEY":"NOTAVALUE"}}' -u admin:admin -k 'https://localhost/pulp/api/v2/repositories/zoo/distributors/yum_distributor/'

3. Retrieve the resulting task: curl -i -H "Accept: application/json" -X GET -u admin:admin -k 'https://localhost/pulp/api/v2/tasks/<task-id>/'

4. Update the importer: curl -i -H "Accept: application/json" -X PUT -d '{ "importer_config": {"NOTAKEY":"NOTAVALUE"}}' -u admin:admin -k 'https://localhost/pulp/api/v2/repositories/zoo/importers/yum_importer/'

5. Retrieve the resulting task: curl -i -H "Accept: application/json" -X GET -u admin:admin -k 'https://localhost/pulp/api/v2/tasks/<task-id>/'

Actual results:
Distributor results:
    "_href": "/pulp/api/v2/tasks/52d953d4-3d7c-4b5e-8b15-02c0bf84ae05/",
    "_id": {
        "$oid": "53e3a2cab53073e66875f0ed"
    "_ns": "task_status",
    "error": {
        "code": "PLP0000",
        "data": {},
        "description": "Configuration key [NOTAKEY] is not supported",
        "sub_errors": []
    "exception": null,
    "finish_time": "2014-08-07T16:01:14Z",
    "id": "53e3a2ca7bc8f6604cd176ca",
    "progress_report": {},
    "queue": "reserved_resource_worker-4@jcline.redhat.com.dq",
    "result": null,
    "spawned_tasks": [],
    "start_time": "2014-08-07T16:01:14Z",
    "state": "error",
    "tags": [
    "task_id": "52d953d4-3d7c-4b5e-8b15-02c0bf84ae05",
    "task_type": "pulp.server.tasks.repository.distributor_update",
    "traceback": "Traceback (most recent call last):\n  File \"/usr/lib/python2.7/site-packages/celery/app/trace.py\", line 240, in trace_task\n    R = retval = fun(*args, **kwargs)\n  File \"/home/jcline/devel/pulp/server/pulp/server/async/tasks.py\", line 306, in __call__\n    return super(Task, self).__call__(*args, **kwargs)\n  File \"/usr/lib/python2.7/site-packages/celery/app/trace.py\", line 437, in __protected_call__\n    return self.run(*args, **kwargs)\n  File \"/home/jcline/devel/pulp/server/pulp/server/tasks/repository.py\", line 143, in distributor_update\n    distributor = manager.update_distributor_config(repo_id, distributor_id, config, auto_publish)\n  File \"/home/jcline/devel/pulp/server/pulp/server/managers/repo/distributor.py\", line 333, in update_distributor_config\n    raise PulpDataException(message)\nPulpDataException: Configuration key [NOTAKEY] is not supported\n"

Importer results: 
    "_href": "/pulp/api/v2/tasks/cb0d38a4-d11f-4bb9-8dd1-dccf5163e33c/",
    "_id": {
        "$oid": "53e3a275b53073e66875f0ec"
    "_ns": "task_status",
    "error": null,
    "exception": null,
    "finish_time": "2014-08-07T15:59:49Z",
    "id": "53e3a2757bc8f6604cd176c9",
    "progress_report": {},
    "queue": "reserved_resource_worker-2@jcline.redhat.com.dq",
    "result": {
        "_id": {
            "$oid": "53e267d17bc8f602856d69c0"
        "_ns": "repo_importers",
        "config": {
            "NOTAKEY": "NOTAVALUE",
            "feed": "https://repos.fedorapeople.org/repos/pulp/pulp/demo_repos/zoo/"
        "id": "yum_importer",
        "importer_type_id": "yum_importer",
        "last_sync": "2014-08-06T20:11:47Z",
        "repo_id": "zoo",
        "scheduled_syncs": [],
        "scratchpad": null
    "spawned_tasks": [],
    "start_time": "2014-08-07T15:59:49Z",
    "state": "finished",
    "tags": [
    "task_id": "cb0d38a4-d11f-4bb9-8dd1-dccf5163e33c",
    "task_type": "pulp.server.managers.repo.importer.update_importer_config",
    "traceback": null

Expected results: Either both accept unused keys, or both do not.

Additional info:

Comment 1 Brian Bouterse 2015-02-28 22:14:47 UTC
Moved to https://pulp.plan.io/issues/484