Bug 1019155 - invalid _href attribute of a consumer--repo--distributor binding
invalid _href attribute of a consumer--repo--distributor binding
Status: CLOSED CURRENTRELEASE
Product: Pulp
Classification: Community
Component: API/integration (Show other bugs)
2.2
Unspecified Unspecified
medium Severity unspecified
: ---
: 2.4.0
Assigned To: Mike McCune
pulp-qe-list
https://pulp-dev-guide.readthedocs.or...
: Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-10-15 04:43 EDT by mkovacik
Modified: 2014-08-09 02:55 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-08-09 02:55:21 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description mkovacik 2013-10-15 04:43:19 EDT
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 01:42:16 EST
Fix in PR: https://github.com/pulp/pulp/pull/716
Comment 3 Jeff Ortel 2014-04-03 09:36:23 EDT
build: 2.4.0-0.7.beta
Comment 4 mkovacik 2014-04-25 10:42:40 EDT
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 02:55:21 EDT
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.