Bug 147989 - fix the csv module used by rhn-download-manager so it's compatible with csv module used in Python 2.3+
fix the csv module used by rhn-download-manager so it's compatible with csv m...
Status: CLOSED CURRENTRELEASE
Product: Red Hat Network
Classification: Red Hat
Component: RHN/Backend (Show other bugs)
rhn370
All Linux
medium Severity medium
: ---
: ---
Assigned To: John Wregglesworth
Red Hat Satellite QA List
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-02-14 11:16 EST by John Wregglesworth
Modified: 2007-04-18 13:19 EDT (History)
2 users (show)

See Also:
Fixed In Version: rhn370
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-09-29 16:51:53 EDT
Type: ---
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 John Wregglesworth 2005-02-14 11:16:48 EST
Description of problem: The csv module used by rhn-download-manager is
not compatible with the csv module used by Python 2.3+. 


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


How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:
Comment 1 John Wregglesworth 2005-02-15 15:25:44 EST
The csv module has changed considerably between the version used in
rhn_csv and what's included in the Python distribution now. I modified
rhn_csv to use the old stuff if it's being run on a system with a
pre-2.3 version of Python, but otherwise it takes advantage of the new
csv module in Python 2.3+.
Comment 2 John Wregglesworth 2005-02-21 17:10:10 EST
I modified rhn_csv again because misa pointed out that another version
of it already exists in rhn/scripts. I copied the version in
rhn/scripts over to client/download-manager and renamed it csv_lib.py.
I modified rhn_csv.py to use the stuff in csv_lib.py, and in turn
modified download_manager.py to use the new stuff in rhn_csv.py. I'm
working on a test plan.
Comment 3 John Wregglesworth 2005-02-22 11:06:28 EST
NOTE: Steps 1-6 are the same as steps 1-6 in the test plan for 147991
and 147988. If you've already done either of those, 1-6 shouldn't need
to be repeated.

1. If you don't already have the rhn_superuser role in the environment
that you're testing in, ask someone to grant it to your user. Once you
have the rhn_superuser role, you need to set up your user with the
role through the web interface.

2. Now have chris or misa either create a new channel that you can
associate downloads with. The new channel needs to be on whatever
environment you're testing against.

3. Put together some tarballs with some random stuff in them. It
shouldn't matter what the tarballs have in them.

4. Have someone create a new directory in whatever environment you
will be testing in. This directory should be under the mount_point,
which is defined in the rhn_server.conf file in /etc/rhn/defaults/.

5. Once you have the path to the new directory, get the file size and
md5sum and create a csv file. You can get the format that the csv file
needs to be in by running rhn-download-manager using the --list
<channelName> option. It doesn't matter what channel you use, but I'd
recommend one with a small number of packages in it. At least one of
the files should have a download_type of "channel-xml-dump".

6. Next, have someone place the tarballs you made in step 2 in the
directory that was made in step 3.

7. Now, using the csv file created in step 4, run the --upload,
--delete, and --list commands on a machine using Python 2.2. There
shouldn't be any problems.
Examples:
python download_manager.py --server=qa --username=foo --password=bar
--list test-channel0

python download_manager.py --server=qa --username=foo --password=bar
--upload downloads.csv --commit

python download_manager.py --server=qa --username=foo --password=bar
--delete downloads.csv --commit

8.Finally, using the csv file created in step 4, run the --upload,
--delete, and --list commands on a machine using Python 2.3 or later.
The commands look the same as the ones in the example above. There
shouldn't be any errors.

Note: If you run the --upload command more than once with the same
.csv file you will need to use the --force option to avoid the file
modified error.

Comment 4 John Wregglesworth 2005-09-29 16:51:53 EDT
This change was for an internal tool and is already in use.

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