Bug 559092

Summary: solaris2mpm fails to convert patch clusters after around oct 2009 - 'NoneType' object has no attribute 'splitlines'
Product: Red Hat Satellite 5 Reporter: Xixi <xdmoon>
Component: SolarisAssignee: Miroslav Suchý <msuchy>
Status: CLOSED ERRATA QA Contact: Martin Minar <mminar>
Severity: high Docs Contact:
Priority: high    
Version: 530CC: adellape, cperry, jrooth, mkoci, mminar, mmraka, mosvald, msuchy, tao, tommyf, xdmoon
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: rhnpush-5.5.4-12 RHATsmart-5.4.1-2 rhn-solaris-bootstrap-5.4.1-5 Doc Type: Bug Fix
Doc Text:
The solaris2mpm utility is now able to convert patch clusters that use the new format from October 2009.
Story Points: ---
Clone Of:
: 681960 (view as bug list) Environment:
Last Closed: 2011-07-19 08:43:56 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 596147, 715348    
Attachments:
Description Flags
install_cluster workaround patch for pm.py
none
possible install_cluster change for solaris2mpm (untested) none

Description Xixi 2010-01-27 06:12:08 UTC
Description of problem:
The solaris2mpm command does convert patch clusters after around October 2009. The latest patch clusters from Sun for Solaris have changed in format (this webpage that describes the changes made by Sun: http://blogs.sun.com/patch/entry/improvements_to_solaris_10_recommended). 

When solaris2mpm is run, it generates a traceback error, e.g.,
# solaris2mpm --tempdir=/newpool/tmp --select-arch=sparc 10_Recommended.zip
Opening archive, this may take a while
Error creating mpm for /newpool/patchtesting/sparc/10_Recommended.zip:
Traceback (most recent call last):
File "/opt/redhat/rhn/solaris/lib/python2.4/site-packages/rhnpush/solaris2mpm.py", line 219, in _run
  pkg_mpm = create_pkg_mpm(archive_parser, prefix=dir)
File "/opt/redhat/rhn/solaris/lib/python2.4/site-packages/rhnpush/solaris2mpm.py", line 435, in create_pkg_mpm
  dct = parse_pkginfo(pkginfo_str)
File "/opt/redhat/rhn/solaris/lib/python2.4/site-packages/rhnpush/solaris2mpm.py", line 473, in parse_pkginfo
  lines = pkginfo_str.splitlines()
AttributeError: 'NoneType' object has no attribute 'splitlines'

Version-Release number of selected component (if applicable):
Red Hat Network (RHN) Satellite 5.3.0
Solaris rhn client information:
pkginfo |grep RHAT
utility     RHATossl                     openssl 0.9.7a
utility     RHATpossl                    pyOpenSSL 0.6
utility     RHATpythn                    python 2.4.1
utility     RHATrcfg                     rhncfg 5.1.0
utility     RHATrcfga                    rhncfg-actions 5.1.0
utility     RHATrcfgc                    rhncfg-client 5.1.0
utility     RHATrcfgm                    rhncfg-management 5.1.0
utility     RHATrhnc                     rhnclient 5.3.0
utility     RHATrhnl                     rhnlib 1.8
utility     RHATrpush                    rhnpush 5.3.1
utility     RHATsmart                    smartpm 5.3.0

How reproducible:
Always.

Steps to Reproduce:
1. Download a new Solaris patch cluster. Verify that it does not contain the individual patches in the top-level directory. 
2. Run solaris2mpm.

Actual results:
solaris2mpm fails with above traceback error.

Expected results:
solaris2mpm is able to generate the mpm's.

Additional info:

Comment 2 Clifford Perry 2010-01-29 19:42:16 UTC
*** Bug 557048 has been marked as a duplicate of this bug. ***

Comment 3 Clifford Perry 2010-01-29 19:44:41 UTC
The following comments are copy/paste from bug 557048 as I feel that they are relevant. 

 Tommy Fallsen      2010-01-20 04:11:05 EST

Get a traceback from running command to covert a Solaris patch cluster into mpm
archive.

Package rhnpush-5.3.1-5.el5sat

Steps to Reproduce:
1. Obtain January 8 Patch cluster from sunsolve.sun.com for Solaris 10
2. run solaris2mpm 10_x86_Recommended.zip or 10_Recommended.zip


Actual results:
[root@hostname tmp]# solaris2mpm 10_x86_Recommended.zip
Opening archive, this may take a while
Error creating mpm for /var/satellite/tmp/10_x86_Recommended.zip:
Traceback (most recent call last):
  File "/usr/share/rhn/rhnpush/solaris2mpm.py", line 219, in _run
    pkg_mpm = create_pkg_mpm(archive_parser, prefix=dir)
  File "/usr/share/rhn/rhnpush/solaris2mpm.py", line 435, in create_pkg_mpm
    dct = parse_pkginfo(pkginfo_str)
  File "/usr/share/rhn/rhnpush/solaris2mpm.py", line 473, in parse_pkginfo
    lines = pkginfo_str.splitlines()
AttributeError: 'NoneType' object has no attribute 'splitlines'

Expected results:
A mpm archive for patch cluster.

Additional info:
Sparc version of patch cluster has same problem.    

[reply] [-]
Private
Comment 1 Tommy Fallsen 2010-01-20 04:50:58 EST

Had no problems with latest Recommended Patch cluster for Solaris 8 and 9.    

[reply] [-]
Private
Comment 2 Tommy Fallsen 2010-01-20 05:41:27 EST

Older cluster work:
[root@hostname e]#  solaris2mpm --tempdir=/var/satellite/tmp/tmp/
10_Recommended.zip
Opening archive, this may take a while
Writing
patch-cluster-solaris-10_Recommended-20081117-1.sparc-solaris-patch-cluster.mpm
Writing patch-solaris-118666-17-1.sparc-solaris-patch.mpm    

[reply] [-]
Private
Comment 3 Tommy Fallsen 2010-01-22 05:50:05 EST

Workaround
unzip 10_x86_Recommended.zip;
Rename README => CLUSTER_README
Change date format to Jan/08/10 in CLUSTER_README
Rename installcluster => install_cluster
Move all patches one level down from patches directory
zip -q -r 10_x86_Recommended.zip 10_x86_Recommended && solaris2mpm
--tempdir=/var/satellite/tmp/tmp/ 10_x86_Recommended.zip
Opening archive, this may take a while
Writing
patch-cluster-solaris-10_x86_Recommended-20100108-1.i386-solaris-patch-cluster.mpm
Writing patch-solaris-113000-07-1.i386-solaris-patch.mpm
Writing patch-solaris-117435-02-1.i386-solaris-patch.mpm
Writing patch-solaris-118344-14-1.i386-solaris-patch.mpm
Writing patch-solaris-118668-24-1.i386-solaris-patch.mpm
Writing patch-solaris-118669-24-1.i386-solaris-patch.mpm
Writing patch-solaris-118778-13-1.i386-solaris-patch.mpm

Comment 4 Xixi 2010-03-02 19:07:57 UTC
(In reply to comment #3)
> Workaround
> unzip 10_x86_Recommended.zip;
> Rename README => CLUSTER_README
> Change date format to Jan/08/10 in CLUSTER_README
> Rename installcluster => install_cluster
> Move all patches one level down from patches directory
> zip -q -r 10_x86_Recommended.zip 10_x86_Recommended && solaris2mpm
> --tempdir=/var/satellite/tmp/tmp/ 10_x86_Recommended.zip
> Opening archive, this may take a while
> Writing
> patch-cluster-solaris-10_x86_Recommended-20100108-1.i386-solaris-patch-cluster.mpm
> Writing patch-solaris-113000-07-1.i386-solaris-patch.mpm
> Writing patch-solaris-117435-02-1.i386-solaris-patch.mpm
> Writing patch-solaris-118344-14-1.i386-solaris-patch.mpm
> Writing patch-solaris-118668-24-1.i386-solaris-patch.mpm
> Writing patch-solaris-118669-24-1.i386-solaris-patch.mpm
> Writing patch-solaris-118778-13-1.i386-solaris-patch.mpm    

Adapted steps from testing above internally:

1. cd /tmp/
2. unzip /root/it375873/10_x86_Recommended.zip
3. cd 10_x86_Recommended/
4. mv README CLUSTER_README
5. vi CLUSTER_README (Change date format to Dec/07/09)
6. mv installcluster install_cluster
7. mv patches/* . (say yes when it asks to replace patch_order, the files should be identical)
8. back up and apply attached patch solaris2mpm.375873.TEST.1.patch to /usr/share/rhn/rhnpush/solaris2mpm.py (<--- only applicable if you're trying to convert a x68 patch cluster, see bug 569946 for patch) 
9. zip -q -r 10_x86_Recommended.zip 10_x86_Recommended && solaris2mpm
--tempdir=/var/satellite/tmp/tmp/ 10_x86_Recommended.zip

It should now be creating the mpm files -
"Opening archive, this may take a while
Writing patch-cluster-solaris-10_x86_Recommended-20091207-1.i386-solaris-patch-cluster.mpm
Writing patch-solaris-113000-07-1.i386-solaris-patch.mpm
Writing patch-solaris-117435-02-1.i386-solaris-patch.mpm
Writing patch-solaris-118344-14-1.i386-solaris-patch.mpm
Writing patch-solaris-118668-24-1.i386-solaris-patch.mpm
Writing patch-solaris-118669-24-1.i386-solaris-patch.mpm
Writing patch-solaris-118844-20-1.i386-solaris-patch.mpm
Writing patch-solaris-118855-36-1.i386-solaris-patch.mpm
Writing patch-solaris-118919-21-1.i386-solaris-patch.mpm
Writing patch-solaris-119060-46-1.i386-solaris-patch.mpm
Writing patch-solaris-119082-25-1.i386-solaris-patch.mpm
Writing patch-solaris-119116-35-1.i386-solaris-patch.mpm
..."

There are a good many files so this will take some time.

Comment 6 Miroslav Suchý 2010-05-06 14:56:39 UTC
Fixed in spacewalk git.
commits: 
d66c784bca6da929568ec058fcbf5b0ac1064242
aa286843fa4680af003dc998154112b1bf115170 and everything till 17763722f18c75c33414d8d892171faaaa86c25b

Comment 7 Miroslav Suchý 2010-05-18 14:53:15 UTC
Cherrypicked to satellite.git 
Commits: fd6ad0c538c35f9b94c566c8b99dad9ebfa9d347 ..
b7a8c9eb94de4caabaaaceff82f8b4008ed3a207
And I had to cherrypick e7a174a368ee496f3a7928bedb0e46f2a1ceede4

Comment 12 Jaromir Hradilek 2010-09-02 21:04:20 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
The solaris2mpm utility is now able to convert patch clusters that use the new format from October 2009.

Comment 17 Xixi 2011-03-03 21:30:48 UTC
*** Bug 681960 has been marked as a duplicate of this bug. ***

Comment 27 Miroslav Suchý 2011-05-05 12:59:38 UTC
> would you suggest a good rhnsun system that's accessible right
now to test?
All solaris machines I know are here:
http://svn.rhndev.redhat.com/viewcvs/trunk/docs/it/resource-allocation.txt

Comment 32 Michael Mráka 2011-06-20 20:34:30 UTC
More fixes in spacewalk git:
commit 33a363f20b7ce2bdb39a8b0692ee1017544bfb14
    559092 - recognize both new and old patch clusters
commit 34541a3be8de761467cb015ae672f890488e0eeb
    559092 - made patch cluster dir readable for nobody
    fixing
    application of 119254-80 failed : unhandled subprocess exit status '5' (exit n branch)
commit 9b78b9ee725eed74aa5bfd624469dce580d559d6
    559092 - new solaris patches contain installcluster

Comment 35 Michael Mráka 2011-07-01 08:07:25 UTC
Backported to SATELLITE-5.4 as
commit 3e30002aaab3c2f7f29ee6ffbb304201be980cf5
    559092 - recognize both new and old patch clusters
commit 0527fcf0f4a8e30a2cc916a9047b57dd6a07b2fe
    559092 - made patch cluster dir readable for nobody
    fixing
    application of 119254-80 failed : unhandled subprocess exit status '5' (exit n branch)
commit 7395e0620c55576f71ff5f33c88809a697b0475f
    559092 - new solaris patches contain installcluster

Comment 37 Michael Mráka 2011-07-14 08:20:00 UTC
Fixed one more bug - intallation on x86:

commit 61ce0bd8a24ef441af08538c5b7ad0db0be16a1b
    559092 - fixed patchset installation on x86

Comment 39 errata-xmlrpc 2011-07-19 08:43:56 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-0957.html