Bug 1038309 - el5 repos do not have their checksum set if distributor_id does not match distributor_type_id
Summary: el5 repos do not have their checksum set if distributor_id does not match dis...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Pulp
Classification: Retired
Component: rpm-support
Version: 2.3
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: 2.3.1
Assignee: Barnaby Court
QA Contact: Preethi Thomas
URL:
Whiteboard:
Depends On:
Blocks: 1021674
TreeView+ depends on / blocked
 
Reported: 2013-12-04 21:17 UTC by Justin Sherrill
Modified: 2014-03-18 16:06 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-03-18 16:06:22 UTC
Embargoed:


Attachments (Terms of Use)

Description Justin Sherrill 2013-12-04 21:17:14 UTC
Description of problem:

If the distributor_id does not match the distributor_type_id ('yum_distributor') then the auto-detection of a sha1 upstream repo does not cause the repo's distributor to have its config set to 'sha1'.  It is not set to anything.  


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

How reproducible:
Always

Steps to Reproduce:
1.  Create a yum repository and ensure that its yum_distributor's id is something other than "yum_distributor".  Point the feed url to rhel 5 repo that uses sha1
2.  Sync & publish the repo
3.  Check the checksum type on the repo

Actual results:
Checksum type is not set

Expected results:
Checksum type should be set to 'sha1'

Comment 1 Barnaby Court 2013-12-05 14:31:15 UTC
PR: https://bugzilla.redhat.com/show_bug.cgi?id=1038309

Comment 2 Michael Hrivnak 2013-12-05 15:02:26 UTC
Actual PR link: https://github.com/pulp/pulp_rpm/pull/408

Comment 3 Jeff Ortel 2013-12-05 22:19:50 UTC
build: 2.3.1-0.4.beta

Comment 4 Barnaby Court 2013-12-09 18:09:56 UTC
To verify this you will need to create a distributor on a repository with a different id than the distributor type.  

Two possible ways to do this.  
1) Create a new repo using the command line that has a feed to a rhel5 repo
2) Find the yum_distributor in the mongo database repo_distributors collection
3) Update the id field of the distributor to be something other than "yum_distributor"
4) Sync the repository
5) Publish the repository
5) Go back to the mongo database and verify that the checksum type has been specified on the distributor that was modified in step 3

Second option is to use the rest API to create the repository and the distributor directly while specifying something other than "yum_distributor" as the id of the yum distributor.

Comment 5 Barnaby Court 2013-12-09 18:49:06 UTC
Here is the PIC command
pic.POST('/v2/repositories/', {"distributors": [{"distributor_id": "distid", "auto_publish": True, "distributor_type": "yum_distributor", "distributor_config": {"skip": ["rpm"], "http": False, "relative_url": "rhel5", "https": True}}, {"distributor_id": "export_distributor", "auto_publish": False, "distributor_type": "export_distributor", "distributor_config": {"skip": ["rpm"], "http": False, "https": True}}], "notes": {"_repo-type": "rpm-repo"}, "importer_type_id": "yum_importer", "importer_config": {"feed": "http://download.devel.redhat.com/cds/prod/content/dist/rhel/server/5/5.10/x86_64/os/", "validate": True, "type_skip_list": ["rpm"]}, "id": "rhel5"} )

Comment 6 Preethi Thomas 2013-12-10 15:20:58 UTC
In [3]: pic.POST('/v2/repositories/', {"distributors": [{"distributor_id": "distid", "auto_publish": True, "distributor_type": "yum_distributor", "distributor_config": {"skip": ["rpm"], "http": False, "relative_url": "rhel5", "https": True}}, {"distributor_id": "export_distributor", "auto_publish": False, "distributor_type": "export_distributor", "distributor_config": {"skip": ["rpm"], "http": False, "https": True}}], "notes": {"_repo-type": "rpm-repo"}, "importer_type_id": "yum_importer", "importer_config": {"feed": "http://download.devel.redhat.com/cds/prod/content/dist/rhel/server/5/5.10/x86_64/os/", "validate": True, "type_skip_list": ["rpm"]}, "id": "rhel5"} )
Request Body
{
  "notes": {
    "_repo-type": "rpm-repo"
  }, 
  "importer_type_id": "yum_importer", 
  "importer_config": {
    "feed": "http://download.devel.redhat.com/cds/prod/content/dist/rhel/server/5/5.10/x86_64/os/", 
    "validate": true, 
    "type_skip_list": [
      "rpm"
    ]
  }, 
  "id": "rhel5", 
  "distributors": [
    {
      "distributor_id": "distid", 
      "auto_publish": true, 
      "distributor_type": "yum_distributor", 
      "distributor_config": {
        "skip": [
          "rpm"
        ], 
        "http": false, 
        "https": true, 
        "relative_url": "rhel5"
      }
    }, 
    {
      "distributor_id": "export_distributor", 
      "auto_publish": false, 
      "distributor_type": "export_distributor", 
      "distributor_config": {
        "skip": [
          "rpm"
        ], 
        "http": false, 
        "https": true
      }
    }
  ]
}
Response Body
{
  "scratchpad": {}, 
  "display_name": "rhel5", 
  "description": null, 
  "_ns": "repos", 
  "notes": {
    "_repo-type": "rpm-repo"
  }, 
  "content_unit_counts": {}, 
  "_id": {
    "$oid": "52a72a3dd669f05eaa8cc561"
  }, 
  "id": "rhel5", 
  "_href": "/pulp/api/v2/repositories/rhel5/"
}
Out[3]: 
(201,
 {u'_href': u'/pulp/api/v2/repositories/rhel5/',
  u'_id': {u'$oid': u'52a72a3dd669f05eaa8cc561'},
  u'_ns': u'repos',
  u'content_unit_counts': {},
  u'description': None,
  u'display_name': u'rhel5',
  u'id': u'rhel5',
  u'notes': {u'_repo-type': u'rpm-repo'},
  u'scratchpad': {}})


[root@pulp-v2-server ~]# pulp-admin rpm repo sync run --repo-id rhel5
+----------------------------------------------------------------------+
                    Synchronizing Repository [rhel5]
+----------------------------------------------------------------------+

This command may be exited by pressing ctrl+c without affecting the actual
operation on the server.

Downloading metadata...
[/]
... completed

Downloading repository content...
[==================================================] 100%
RPMs:       0/0 items
Delta RPMs: 0/0 items

... completed

Downloading distribution files...
[==================================================] 100%
Distributions: 19/19 items
... completed

Importing errata...
[/]
... completed

Importing package groups/categories...
[\]
... completed

[root@pulp-v2-server ~]# pulp-admin repo list --details
+----------------------------------------------------------------------+
                              Repositories
+----------------------------------------------------------------------+

Id:                  rhel5
Display Name:        rhel5
Description:         None
Content Unit Counts: 
  Distribution:           1
  Erratum:                2863
  Package Category:       6
  Package Group:          99
  Yum Repo Metadata File: 1
Notes:               
Importers:           
  Config:           
    Feed:           http://download.devel.redhat.com/cds/prod/content/dist/rhel/
                    server/5/5.10/x86_64/os/
    Type Skip List: rpm
    Validate:       True
  Id:               yum_importer
  Importer Type Id: yum_importer
  Last Sync:        2013-12-10T09:59:00-05:00
  Repo Id:          rhel5
  Scheduled Syncs:  
Distributors:        
  Auto Publish:        False
  Config:              
    Http:  False
    Https: True
    Skip:  rpm
  Distributor Type Id: export_distributor
  Id:                  export_distributor
  Last Publish:        None
  Repo Id:             rhel5
  Scheduled Publishes: 
  Auto Publish:        True
  Config:              
    Checksum Type: sha1
    Http:          False
    Https:         True
    Relative URL:  rhel5
    Skip:          rpm
  Distributor Type Id: yum_distributor
  Id:                  distid
  Last Publish:        2013-12-10T09:59:05-05:00
  Repo Id:             rhel5
  Scheduled Publishes: 


[root@pulp-v2-server ~]#

Comment 7 Preethi Thomas 2013-12-10 17:00:34 UTC
verified

[root@pulp-v2-server ~]# rpm -qa pulp-server
pulp-server-2.3.1-0.4.beta.el6.noarch
[root@pulp-v2-server ~]#

Comment 8 Preethi Thomas 2013-12-10 21:52:20 UTC
Also bound the repo to the consumer.

In [6]: pic.POST('/v2/consumers/client/bindings/',body={'repo_id':'rhel5', 'distributor_id': 'distid' })
Request Body
{
  "repo_id": "rhel5", 
  "distributor_id": "distid"
}
Response Body
[
  {
    "task_group_id": "986aa03f-37cb-40be-839c-e464abc8bf02", 
    "call_request_id": "dc1ecc6d-43ab-4b2f-96b9-d01d9fc72a6e", 
    "exception": null, 
    "_href": "/pulp/api/v2/task_groups/986aa03f-37cb-40be-839c-e464abc8bf02/", 
    "task_id": "dc1ecc6d-43ab-4b2f-96b9-d01d9fc72a6e", 
    "call_request_tags": [
      "pulp:consumer:client", 
      "pulp:repository:rhel5", 
      "pulp:repository_distributor:distid", 
      "pulp:action:bind"
    ], 
    "reasons": [], 
    "start_time": null, 
    "traceback": null, 
    "schedule_id": null, 
    "finish_time": null, 
    "state": "waiting", 
    "result": null, 
    "dependency_failures": {}, 
    "call_request_group_id": "986aa03f-37cb-40be-839c-e464abc8bf02", 
    "progress": {}, 
    "principal_login": "admin", 
    "response": "accepted", 
    "tags": [
      "pulp:consumer:client", 
      "pulp:repository:rhel5", 
      "pulp:repository_distributor:distid", 
      "pulp:action:bind"
    ]
  }, 
  {
    "task_group_id": "986aa03f-37cb-40be-839c-e464abc8bf02", 
    "call_request_id": "5ba582cf-5863-4b34-9021-2e0dcdad5d47", 
    "exception": null, 
    "_href": "/pulp/api/v2/task_groups/986aa03f-37cb-40be-839c-e464abc8bf02/", 
    "task_id": "5ba582cf-5863-4b34-9021-2e0dcdad5d47", 
    "call_request_tags": [
      "pulp:consumer:client", 
      "pulp:repository:rhel5", 
      "pulp:repository_distributor:distid", 
      "pulp:action:agent_bind"
    ], 
    "reasons": [], 
    "start_time": null, 
    "traceback": null, 
    "schedule_id": null, 
    "finish_time": null, 
    "state": "waiting", 
    "result": null, 
    "dependency_failures": {}, 
    "call_request_group_id": "986aa03f-37cb-40be-839c-e464abc8bf02", 
    "progress": {}, 
    "principal_login": "admin", 
    "response": "accepted", 
    "tags": [
      "pulp:consumer:client", 
      "pulp:repository:rhel5", 
      "pulp:repository_distributor:distid", 
      "pulp:action:agent_bind"
    ]
  }
]
Out[6]: 
(202,
 [{u'_href': u'/pulp/api/v2/task_groups/986aa03f-37cb-40be-839c-e464abc8bf02/',
   u'call_request_group_id': u'986aa03f-37cb-40be-839c-e464abc8bf02',
   u'call_request_id': u'dc1ecc6d-43ab-4b2f-96b9-d01d9fc72a6e',
   u'call_request_tags': [u'pulp:consumer:client',
                          u'pulp:repository:rhel5',
                          u'pulp:repository_distributor:distid',
                          u'pulp:action:bind'],
   u'dependency_failures': {},
   u'exception': None,
   u'finish_time': None,
   u'principal_login': u'admin',
   u'progress': {},
   u'reasons': [],
   u'response': u'accepted',
   u'result': None,
   u'schedule_id': None,
   u'start_time': None,
   u'state': u'waiting',
   u'tags': [u'pulp:consumer:client',
             u'pulp:repository:rhel5',
             u'pulp:repository_distributor:distid',
             u'pulp:action:bind'],
   u'task_group_id': u'986aa03f-37cb-40be-839c-e464abc8bf02',
   u'task_id': u'dc1ecc6d-43ab-4b2f-96b9-d01d9fc72a6e',
   u'traceback': None},
  {u'_href': u'/pulp/api/v2/task_groups/986aa03f-37cb-40be-839c-e464abc8bf02/',
   u'call_request_group_id': u'986aa03f-37cb-40be-839c-e464abc8bf02',
   u'call_request_id': u'5ba582cf-5863-4b34-9021-2e0dcdad5d47',
   u'call_request_tags': [u'pulp:consumer:client',
                          u'pulp:repository:rhel5',
                          u'pulp:repository_distributor:distid',
                          u'pulp:action:agent_bind'],
   u'dependency_failures': {},
   u'exception': None,
   u'finish_time': None,
   u'principal_login': u'admin',
   u'progress': {},
   u'reasons': [],
   u'response': u'accepted',
   u'result': None,
   u'schedule_id': None,
   u'start_time': None,
   u'state': u'waiting',
   u'tags': [u'pulp:consumer:client',
             u'pulp:repository:rhel5',
             u'pulp:repository_distributor:distid',
             u'pulp:action:agent_bind'],
   u'task_group_id': u'986aa03f-37cb-40be-839c-e464abc8bf02',
   u'task_id': u'5ba582cf-5863-4b34-9021-2e0dcdad5d47',
   u'traceback': None}])

In [7]:

Comment 9 Preethi Thomas 2014-03-18 16:06:22 UTC
These were already verified in the corresponding releases that they were fixed in. Moving them to closed current release.


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