Project

Profile

Help

Issue #804

API call to associate/unassociate a unit to with bad criteria returns unhelpful exception

Added by amacdona@redhat.com over 6 years ago. Updated 4 months ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Platform Release:
2.7.0
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 2
Sprint:
Quarter:

Description

A call to /v2/repositories/<destination_repo_id>/actions/associate/ with invalid criteria returns an unhelpful exception.

To replicate

curl -s -H "Accept: application/json" -H "WebFrameworkSwitch: webpy" -X POST -d '{"source_repo_id": "zoo", "criteria": {"bad": "criteria"}}' -k -u admin:admin "https://localhost/pulp/api/v2/repositories/test/actions/associate/" | python -mjson.tool

Actual Result

{
    "_href": "/pulp/api/v2/repositories/test/actions/associate/",
    "args": [],
    "error": {
        "code": "PLP0000",
        "data": {},
        "description": "Pulp exception occurred: PulpDataException",
        "sub_errors": []
    },
    "error_message": "Pulp exception occurred: PulpDataException",
    "exception": null,
    "http_request_method": "POST",
    "http_status": 400,
    "traceback": null
}

Expected Result

{
    "_href": "/pulp/api/v2/repositories/test/actions/associate/",
    "error": {
        "code": "PLP0015",
        "data": {
            "properties": "['repo_criteria']",
            "property_names": [
                "repo_criteria"
            ]
        },
        "description": "Invalid properties: ['repo_criteria']",
        "sub_errors": [
            {
                "code": "PLP0015",
                "data": {
                    "properties": "['bad']",
                    "property_names": [
                        "bad"
                    ]
                },
                "description": "Invalid properties: ['bad']",
                "sub_errors": []
            }
        ]
    },
    "error_message": "Invalid properties: ['repo_criteria']",
    "exception": null,
    "http_request_method": "POST",
    "http_status": 400,
    "property_names": [
        "repo_criteria"
    ],
    "traceback": null
}

Note: This will be fixed in the Django Conversion

Associated revisions

Revision 089b0f0e View on GitHub
Added by Austin Macdonald over 6 years ago

django conversion - repositories

closes #707 closes #749 closes #756 closes #804 closes #805 closes #812

Revision 089b0f0e View on GitHub
Added by Austin Macdonald over 6 years ago

django conversion - repositories

closes #707 closes #749 closes #756 closes #804 closes #805 closes #812

History

#1 Updated by amacdona@redhat.com over 6 years ago

  • Subject changed from API call to associate content to another repo eats the exceptions for bad criteria to API call to associate/unassociate a unit to with bad criteria returns unhelpful exception

#2 Updated by Anonymous over 6 years ago

  • Status changed from ASSIGNED to MODIFIED
  • % Done changed from 0 to 100

#3 Updated by rbarlow over 6 years ago

  • Platform Release changed from master to 2.7.0

#4 Updated by dkliban@redhat.com about 6 years ago

  • Status changed from MODIFIED to 5

#5 Updated by pthomas@redhat.com about 6 years ago

verified

[root@mgmt4 ~]# rpm -qa pulp-server
pulp-server-2.7.0-0.4.beta.el6.noarch
[root@mgmt4 ~]# 
{  
   "http_request_method":"POST",
   "exception":null,
   "error_message":"Invalid properties: ['criteria']",
   "property_names":[  
      "criteria"
   ],
   "_href":"/pulp/api/v2/repositories/test/actions/associate/",
   "http_status":400,
   "error":{  
      "code":"PLP0015",
      "data":{  
         "property_names":[  
            "criteria"
         ],
         "properties":"['criteria']"
      },
      "description":"Invalid properties: ['criteria']",
      "sub_errors":[  
         {  
            "code":"PLP0015",
            "data":{  
               "property_names":[  
                  "bad"
               ],
               "properties":"['bad']"
            },
            "description":"Invalid properties: ['bad']",
            "sub_errors":[  

            ]
         }
      ]
   },
   "traceback":null
}

#6 Updated by pthomas@redhat.com about 6 years ago

  • Status changed from 5 to 6

#7 Updated by amacdona@redhat.com over 5 years ago

  • Status changed from 6 to CLOSED - CURRENTRELEASE

#9 Updated by bmbouter over 2 years ago

  • Tags Pulp 2 added

Please register to edit this issue

Also available in: Atom PDF