Bug 991201 - nodes validation checking plugin IDs instead of type_id
nodes validation checking plugin IDs instead of type_id
Status: CLOSED CURRENTRELEASE
Product: Pulp
Classification: Community
Component: nodes (Show other bugs)
2.2 Beta
Unspecified Unspecified
unspecified Severity unspecified
: ---
: 2.2.0
Assigned To: Jeff Ortel
Preethi Thomas
: Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-08-01 15:59 EDT by Jeff Ortel
Modified: 2013-09-10 11:42 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-09-10 11:42:56 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 Jeff Ortel 2013-08-01 15:59:20 EDT
The nodes validation checking plugin IDs instead of type_id.  Caught when the plugin ID is not the same as the type_id.
Comment 1 Michael Hrivnak 2013-08-02 08:57:05 EDT
I agree this is a 2.2 blocker. It should be a very quick fix at least.

This area of distributor IDs and type IDs is very tricky. We may want to consider renaming one or the other at some point in the future to reduce confusion and ambiguity.
Comment 2 Jeff Ortel 2013-08-02 14:34:38 EDT
https://github.com/pulp/pulp/pull/552
Comment 3 Jeff Ortel 2013-08-05 12:19:10 EDT
build: 2.2.0-0.24.beta
Comment 4 Jeff Ortel 2013-08-12 16:19:22 EDT
To verify:

1. Create a repository using the following script instead of pulp-admin.
   This script adds a distributor with an ID that is different than it's type.

2. Enable the repository.

3. Bind the child to the repository.

4. Sync the child node.

--------------------------------------------------------------------

<script>

from pulp.common import pic

pic.connect()

url="/pulp/api/v2/repositories/"

body = {
  "id": "pulp_node_test",
  "display_name": None, 
  "description": None,
  "distributors": [
    {"distributor_id": "REALLY_DIFFERENT_NAME_HERE",
     "auto_publish": True, 
     "distributor_type": "yum_distributor", 
     "distributor_config": {
       "http": False, 
       "https": True, 
       "relative_url": "/repos/pulp/pulp/v2/testing/"
     }}], 
  "notes": {"_repo-type": "rpm-repo"}, 
  "importer_type_id": "yum_importer", 
  "importer_config": {"feed": "http://repos.fedorapeople.org/repos/pulp/pulp/v2/testing/"}
}

pic.POST(url, body)

</script>
Comment 5 Preethi Thomas 2013-08-13 15:24:22 EDT
verified
[root@cloud-qe-9 ~]# rpm -qa pulp-server
pulp-server-2.2.0-0.25.beta.el6.noarch
[root@cloud-qe-9 ~]# 

[root@cloud-qe-9 ~]# python nodes.py 
Request Body
{
  "display_name": null, 
  "description": null, 
  "distributors": [
    {
      "distributor_id": "REALLY_DIFFERENT_NAME_HERE", 
      "auto_publish": true, 
      "distributor_type": "yum_distributor", 
      "distributor_config": {
        "http": false, 
        "relative_url": "/repos/pulp/pulp/v2/testing/", 
        "https": true
      }
    }
  ], 
  "notes": {
    "_repo-type": "rpm-repo"
  }, 
  "importer_type_id": "yum_importer", 
  "importer_config": {
    "feed": "http://repos.fedorapeople.org/repos/pulp/pulp/v2/testing/fedora-19/x86_64/"
  }, 
  "id": "pulp_node_test"
}
Response Body
{
  "scratchpad": {}, 
  "display_name": "pulp_node_test", 
  "description": null, 
  "_ns": "repos", 
  "notes": {
    "_repo-type": "rpm-repo"
  }, 
  "content_unit_counts": {}, 
  "_id": {
    "$oid": "520a82a3d6344947820000ab"
  }, 
  "id": "pulp_node_test", 
  "_href": "/pulp/api/v2/repositories/pulp_node_test/"
}


[root@cloud-qe-9 ~]# pulp-admin node sync run  --node-id node1
This command may be exited via ctrl+c without affecting the request.

[-]
Waiting to begin...



(1/3) Repository: errata
[==================================================] 100%


(2/3) Repository: pulp_node_test
[==================================================] 100%


(3/3) Repository: upload
[==================================================] 100%




Synchronization succeeded

+----------------------------------------------------------------------+
                       Child Node Synchronization
+----------------------------------------------------------------------+

Repository: 
  Action: Merged
  Id:     errata
  Units:  
    Added:   0
    Removed: 0
    Updated: 0

Repository: 
  Action: Added
  Id:     pulp_node_test
  Units:  
 Added:   46
    Removed: 0
    Updated: 0

Repository: 
  Action: Merged
  Id:     upload
  Units:  
    Added:   0
    Removed: 0
    Updated: 0
Comment 6 Preethi Thomas 2013-09-10 11:42:56 EDT
2.2 released
http://repos.fedorapeople.org/repos/pulp/pulp/stable/2.2/

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