Project

Profile

Help

Issue #804

closed

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

Added by amacdona@redhat.com almost 10 years ago. Updated almost 4 years 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

Actions #1

Updated by amacdona@redhat.com almost 10 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

Added by Austin Macdonald over 9 years ago

Revision 089b0f0e | View on GitHub

django conversion - repositories

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

Added by Austin Macdonald over 9 years ago

Revision 089b0f0e | View on GitHub

django conversion - repositories

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

Actions #2

Updated by Anonymous over 9 years ago

  • Status changed from ASSIGNED to MODIFIED
  • % Done changed from 0 to 100
Actions #3

Updated by rbarlow over 9 years ago

  • Platform Release changed from master to 2.7.0
Actions #4

Updated by dkliban@redhat.com over 9 years ago

  • Status changed from MODIFIED to 5
Actions #5

Updated by pthomas@redhat.com over 9 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
}
Actions #6

Updated by pthomas@redhat.com over 9 years ago

  • Status changed from 5 to 6
Actions #7

Updated by amacdona@redhat.com about 9 years ago

  • Status changed from 6 to CLOSED - CURRENTRELEASE
Actions #9

Updated by bmbouter over 5 years ago

  • Tags Pulp 2 added

Also available in: Atom PDF