Project

Profile

Help

Issue #2224

Updated by ipanova@redhat.com over 7 years ago

<pre> 
 $ pulp-admin -vv rpm repo create --repo-id mirror --feed "http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os"    --relative-url mirror 

 2016-09-02 18:47:26,295 2016-09-01 17:08:11,927 - DEBUG - sending POST request to /pulp/api/v2/repositories/ 
 2016-09-02 18:47:27,464 2016-09-01 17:08:12,135 - INFO - POST request to /pulp/api/v2/repositories/ with parameters {"display_name": null, "description": null, "distributors": [{"distributor_id": "yum_distributor", "auto_publish": true, "distributor_config": {"http": false, "relative_url": "mirror", "/mirror", "https": true}, "distributor_type_id": "yum_distributor"}, {"distributor_id": "export_distributor", "auto_publish": false, "distributor_config": {"http": false, "relative_url": "mirror", "/mirror", "https": true}, "distributor_type_id": "export_distributor"}], "notes": {"_repo-type": "rpm-repo"}, "importer_type_id": "yum_importer", "importer_config": {"feed": "http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os"}, "id": "mirror"} 
 2016-09-02 18:47:27,464 2016-09-01 17:08:12,136 - INFO - Response status : 201 400  

 2016-09-02 18:47:27,464 2016-09-01 17:08:12,136 - INFO - Response body : 
  { 
   "scratchpad": {},  
   "display_name": "exception": null,  
   "description": null,  
   "last_unit_added": null,  
   "notes": { "args": [ 
     "_repo-type": "rpm-repo" "Value for [relative_url]    must be be a relative path: /mirror" 
   }, ],  
   "last_unit_removed": "_href": "/pulp/api/v2/repositories/",  
   "traceback": null,  
   "content_unit_counts": {}, "error_message": "Value for [relative_url]    must be be a relative path: /mirror",  
   "_ns": "repos", "http_request_method": "POST",  
   "_id": "http_status": 400,  
   "error": { 
     "$oid": "57c9ad1f45ef480c8e715874" "code": "PLP0000",  
     "data": {},  
     "description": "Value for [relative_url]    must be be a relative path: /mirror",  
     "sub_errors": [] 
   },  
   "id": "mirror",  
   "_href": "/pulp/api/v2/repositories/mirror/" } 
 } 

 Successfully created repository [mirror] 

 $ pulp-admin rpm repo sync run --repo-id=mirror 


 +----------------------------------------------------------------------+ 
                    Synchronizing Repository [mirror] 
 +----------------------------------------------------------------------+ 

 The following sync configuration options will 2016-09-01 17:08:12,136 - ERROR - Exception occurred: 
         href:        /pulp/api/v2/repositories/ 
         method:      POST 
         status:      400 
         error:       Value for [relative_url]    must be used: 


 This command may be exited via ctrl+c without affecting the request. 


 Downloading metadata... a relative path: /mirror 
         traceback: None 
         data:        {u'args': [u'Value for [relative_url]    must be be a relative path: /mirror'], u'error': {u'code': u'PLP0000', u'data': {}, u'description': u'Value for [relative_url]    must be be a relative path: /mirror', u'sub_errors': []}} 
        
 Value for [relative_url]    must be be a relative path: /mirror 
 [\] 
 ... completed 

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

 ... completed 

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

 Errors encountered during distribution sync: 

 Importing errata... 
 [-] 
 ... completed 

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

 Cleaning duplicate packages... 
 [-] 
 ... completed 


 Task Succeeded 
 </pre> 

 I'm afraid this change broke the We need to introduce into validation also situation when mirrorlist sync support https://github.com/pulp/pulp_rpm/commit/221e97797f093191101658114b48c49a45b2eeb5#diff-5185b3f1e5a02c40a5d198fe779c75fbL328 

 is passed into --feed 
 https://github.com/pulp/pulp_rpm/blob/master/plugins/pulp_rpm/plugins/distributors/yum/configuration.py#L398

Back