Bug 1019155 - invalid _href attribute of a consumer--repo--distributor binding
Summary: invalid _href attribute of a consumer--repo--distributor binding
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Pulp
Classification: Retired
Component: API/integration
Version: 2.2
Hardware: Unspecified
OS: Unspecified
medium
unspecified
Target Milestone: ---
: 2.4.0
Assignee: Mike McCune
QA Contact: pulp-qe-list
URL: https://pulp-dev-guide.readthedocs.or...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-10-15 08:43 UTC by mkovacik
Modified: 2014-08-09 06:55 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-08-09 06:55:21 UTC


Attachments (Terms of Use)

Description mkovacik 2013-10-15 08:43:19 UTC
Description of problem:
GETting a consumer--repo--distributor object from the Pulp REST API yields a JSON structure with wrong _href field e.g.:
  /pulp/api/v2/consumers/test_consumer/bindings/test_rpm_repo/test_distributor/test_consumer/test_rpm_repo/test_distributor/

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

How reproducible:
Always

Steps to Reproduce:
1. create a repo, associate it with an yum-type importer and distributor
2. create a consumer
3. bind the consumer to the repo--distributor created
4. result: the binding object has invalid _href field
5. try following the invalid _href field
6. 404 response

Actual results:
_href field of a consumer--repo--distributor object is invalid

Expected results:
_href field of a consumer--repo--distributor object is correct

Additional info:
### Screen log

[mkovacik@malina pulp]$ http --verify=no -a admin:admin  https://pulp.example.com/pulp/api/v2/consumers/test_consumer/bindings/test_rpm_repo/test_distributor/
HTTP/1.1 200 OK
Content-Length: 692
Content-Type: application/json
Date: Tue, 15 Oct 2013 08:23:27 GMT
Server: Apache/2.4.6 (Fedora) OpenSSL/1.0.1e-fips mod_wsgi/3.4 Python/2.7.5

{
    "_href": "/pulp/api/v2/consumers/test_consumer/bindings/test_rpm_repo/test_distributor/test_consumer/test_rpm_repo/test_distributor/", 
    "_id": {
        "$oid": "525cfacec805d07f7010bb79"
    }, 
    "_ns": "consumer_bindings", 
    "binding_config": null, 
    "consumer_actions": [], 
    "consumer_id": "test_consumer", 
    "deleted": false, 
    "details": {
        "ca_cert": null, 
        "client_cert": null, 
        "gpg_keys": [], 
        "protocols": [
            "http", 
            "https"
        ], 
        "relative_path": "/pulp/repos//zoo/", 
        "repo_name": "test_rpm_repo", 
        "server_name": "pulp.example.com"
    }, 
    "distributor_id": "test_distributor", 
    "id": "525cfacec805d07f7010bb79", 
    "notify_agent": true, 
    "repo_id": "test_rpm_repo", 
    "type_id": "yum_distributor"
}

[mkovacik@malina pulp]$ http --verify=no -a admin:admin  https://pulp.example.com/pulp/api/v2/consumers/test_consumer/bindings/test_rpm_repo/test_distributor/test_consumer/test_rpm_repo/test_distributor/
HTTP/1.1 404 Not Found
Content-Length: 9
Content-Type: text/html; charset=UTF-8
Date: Tue, 15 Oct 2013 08:24:45 GMT
Server: Apache/2.4.6 (Fedora) OpenSSL/1.0.1e-fips mod_wsgi/3.4 Python/2.7.5

not found

Comment 1 Jason Connor 2013-11-21 06:42:16 UTC
Fix in PR: https://github.com/pulp/pulp/pull/716

Comment 3 Jeff Ortel 2014-04-03 13:36:23 UTC
build: 2.4.0-0.7.beta

Comment 4 mkovacik 2014-04-25 14:42:40 UTC
Verified in 2.4.0-0.10.beta

# screen log
[root@ec2-54-73-150-13 pulp_auto]# curl -k https://admin:admin@`hostname`/pulp/api/v2/consumers/milan/bindings/zoo/yum_distributor/                                                                                                          
{"notify_agent": true, "repo_id": "zoo", "_href": "/pulp/api/v2/consumers/milan/bindings/zoo/yum_distributor/", "type_id": "yum_distributor", "consumer_actions": [], "_ns": "consumer_bindings", "_id": {"$oid": "535a733ee128540534d5d015"}, "consumer_id": "milan", "deleted": false, "binding_config": {}, "details": {"server_name": "ec2-54-73-150-13.eu-west-1.compute.amazonaws.com", "ca_cert": null, "relative_path": "/pulp/repos/repos/pulp/pulp/demo_repos/zoo/", "gpg_keys": [], "client_cert": null, "protocols": ["https"], "repo_name": "zoo"}, "distributor_id": "yum_distributor", "id": "535a733ee128540534d5d015"}
[root@ec2-54-73-150-13 pulp_auto]#

Comment 5 Randy Barlow 2014-08-09 06:55:21 UTC
This has been fixed in Pulp 2.4.0-1.


Note You need to log in before you can comment on or make changes to this bug.