Bug 1003285

Summary: pulp_node.manifest.UnitWriter.close() uses the closed attribute on a GzipFile, which doesn't exist in Python 2.6
Product: [Retired] Pulp Reporter: Randy Barlow <rbarlow>
Component: nodesAssignee: Jeff Ortel <jortel>
Status: CLOSED CURRENTRELEASE QA Contact: Preethi Thomas <pthomas>
Severity: urgent Docs Contact:
Priority: medium    
Version: MasterCC: mhrivnak
Target Milestone: ---Keywords: Triaged
Target Release: 2.3.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-12-09 14:30:56 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Randy Barlow 2013-09-01 16:21:42 UTC
The close() method of the UnitWriter class looks like this:

def close(self):
        """
        Close and compress the associated file.  This method is idempotent.
        :return: The number of units written.
        :rtype: int
        """
        if not self.fp.closed:
            self.fp.close()
            self.bytes_written = os.path.getsize(self.path)
        return self.total_units

The self.fp.closed line raises an AttributeError in Python 2.6, because the GzipFile object doesn't have that attribute.

Comment 1 Michael Hrivnak 2013-09-03 21:25:20 UTC
This only occurs in pulp's master (2.3).

Comment 2 Michael Hrivnak 2013-09-03 21:26:07 UTC
https://github.com/pulp/pulp/pull/600

Comment 3 Michael Hrivnak 2013-09-10 14:28:19 UTC
I believe there was a discovery that the unit tests were passing an opened gzip file, but that the actual use in-code passes in a regular open file object. If that is true, then the pull request above should be closed, and a new one submitted that fixes the tests.

Comment 4 Jeff Ortel 2013-09-12 22:36:13 UTC
build: 2.3.0-0.10.alpha

Comment 5 Preethi Thomas 2013-09-30 19:24:33 UTC
[root@pulp-node2 ~]# rpm -qa pulp-server

pulp-server-2.3.0-0.16.alpha.el6.noarch
[root@pulp-node2 ~]# 
[root@pulp-node2 ~]# rpm -qa pulp-nodes-child
pulp-nodes-child-2.3.0-0.16.alpha.el6.noarch
[root@pulp-node2 ~]# 


[root@pulp-v2-server ~]# pulp-admin node sync run --node-id node2
This command may be exited via ctrl+c without affecting the request.

[-]
Waiting to begin...



(1/2) Repository: errata-install
[==================================================] 100%


(2/2) Repository: zoo
[==================================================] 100%




Synchronization succeeded

+----------------------------------------------------------------------+
                       Child Node Synchronization
+----------------------------------------------------------------------+

Repository: 
  Action: Merged
  Id:     errata-install
  Units:  
    Added:   0
    Removed: 0
    Updated: 0

Repository: 
  Action: Added
  Id:     zoo
  Units:  
    Added:   0
    Removed: 0
    Updated: 39



[root@pulp-v2-server ~]#

Comment 6 Preethi Thomas 2013-12-09 14:30:56 UTC
Pulp 2.3 released.