Bug 713183 - Repo creation uses Python 2.5 functionality
Summary: Repo creation uses Python 2.5 functionality
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Pulp
Classification: Retired
Component: z_other
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: Sprint 25
Assignee: Pradeep Kilambi
QA Contact: Preethi Thomas
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-06-14 15:28 UTC by Chris St. Pierre
Modified: 2012-02-24 20:18 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:


Attachments (Terms of Use)
Patch to fix the greater portion of this bug (669 bytes, application/octet-stream)
2011-06-14 15:28 UTC, Chris St. Pierre
no flags Details

Description Chris St. Pierre 2011-06-14 15:28:45 UTC
Created attachment 504706 [details]
Patch to fix the greater portion of this bug

Description of problem:

Line 1480 of pulp/client/core/repo.py is:

url_str = urlparse.urlparse(repourl).path.split('/')

In Python 2.4, urlparse.urlparse() returns a tuple without the convenience struct names that were added in Python 2.5, so this breaks.

Additionally, the exception that it produces is caught on line 1489, but then displaying the exception fails because the KeyError that is thrown only has one element, not two.  "except Exception" on line 1489 should probably be narrowed down a bit to the actual kind of exception that is likely to be thrown.

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

0.0.190, HEAD

How reproducible:

Every time.

Steps to Reproduce:

1. Run Pulp on a system with Python 2.4 (e.g., RHEL 5)
2. Try to discover a repository
  
Actual results:

Stack trace'd!

Expected results:

Repo gets discovered.

Additional info:

Patch is attached.

Comment 1 Pradeep Kilambi 2011-06-16 12:50:30 UTC
fixed! commit a9934449650c94c32a717015bda35b6c1c727de8

Comment 2 Jeff Ortel 2011-06-17 21:10:14 UTC
build: 0.192

Comment 3 Preethi Thomas 2011-09-02 17:46:42 UTC
verified

[root@pulp-qe-rhel5 ~]# rpm -q pulp
pulp-0.0.229-1
[root@pulp-qe-rhel5 ~]# cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 5.6 (Tikanga)
[root@pulp-qe-rhel5 ~]# 
[root@pulp-qe-rhel5 ~]# 
[root@pulp-qe-rhel5 ~]# 
[root@pulp-qe-rhel5 ~]# pulp-admin repo discovery
usage: Usage: pulp-admin <options> repo discovery <options>

pulp-admin: error: Option --url is required; please see --help
[root@pulp-qe-rhel5 ~]# pulp-admin repo discovery --url http://repos.fedorapeople.org/repos/pulp/pulp/fedora-15/
usage: Usage: pulp-admin <options> repo discovery <options>

pulp-admin: error: Option --type is required; please see --help
[root@pulp-qe-rhel5 ~]# pulp-admin repo discovery --url http://repos.fedorapeople.org/repos/pulp/pulp/fedora-15/ --type=yum
Discovering urls with yum metadata, This could take some time...
Error: No valid authorization credentials found, please see: pulp-admin --help
[root@pulp-qe-rhel5 ~]# pulp-admin -u admin -p admin repo discovery --url http://repos.fedorapeople.org/repos/pulp/pulp/fedora-15/ --type=yum
Discovering urls with yum metadata, This could take some time...
Number of Urls Discovered (|): 4
+------------------------------------------+
 Repository Urls discovered @ [http://repos.fedorapeople.org/repos/pulp/pulp/fedora-15/]
+------------------------------------------+
(-)  [1] http://repos.fedorapeople.org/repos/pulp/pulp/fedora-15/x86_64
(-)  [2] http://repos.fedorapeople.org/repos/pulp/pulp/fedora-15/x86_64
(-)  [3] http://repos.fedorapeople.org/repos/pulp/pulp/fedora-15/i386
(-)  [4] http://repos.fedorapeople.org/repos/pulp/pulp/fedora-15/i386

Select urls for which candidate repos should be created; use `y` to confirm (h for help):h

  'a'   	 : select all
  'x:y' 	 : select a range eg:1:3
  <sel> 	 : select value in range (1-4) to toggle selection
  'y'   	 : confirm selection
  'c'   	 : clear selections
  'q'   	 : abort the repo creation


Select urls for which candidate repos should be created; use `y` to confirm (h for help):a
(+)  [1] http://repos.fedorapeople.org/repos/pulp/pulp/fedora-15/x86_64
(+)  [2] http://repos.fedorapeople.org/repos/pulp/pulp/fedora-15/x86_64
(+)  [3] http://repos.fedorapeople.org/repos/pulp/pulp/fedora-15/i386
(+)  [4] http://repos.fedorapeople.org/repos/pulp/pulp/fedora-15/i386

Select urls for which candidate repos should be created; use `y` to confirm (h for help):y

Creating candidate repos for selected urls..
Successfully created repo [repos-pulp-pulp-fedora-15-x86_64]
Successfully created repo [repos-pulp-pulp-fedora-15-i386]

Comment 4 Preethi Thomas 2012-02-24 20:17:17 UTC
Pulp v1.0 is released
Closed Current Release.

Comment 5 Preethi Thomas 2012-02-24 20:18:21 UTC
Pulp v1.0 is released.


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