Bug 1460559 - AttributeError: MetaDataGenerator instance has no attribute 'oldData'
AttributeError: MetaDataGenerator instance has no attribute 'oldData'
Status: CLOSED DUPLICATE of bug 1434369
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: createrepo (Show other bugs)
6.9
Unspecified Linux
unspecified Severity unspecified
: rc
: ---
Assigned To: Valentina Mukhamedzhanova
BaseOS QE Security Team
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-06-11 22:17 EDT by Ashfaqur Rahaman
Modified: 2017-06-12 05:16 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-06-12 05:16:57 EDT
Type: Bug
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 Ashfaqur Rahaman 2017-06-11 22:17:07 EDT
Description of problem:

Createrepo gives the error if there is no new package added in the repository. 

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

# cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 6.9 (Santiago)

# rpm -qa|grep createrepo
createrepo-0.9.9-26.el6.noarch


How reproducible:
100%


Steps to Reproduce:
1. create a repository with createrepo 
# createrepo /repo 

2. Update the repository without adding any new package : 
# createrepo -C --update /repo 

Actual results:
------------------
# createrepo -C --update /repo
Traceback (most recent call last):
  File "/usr/share/createrepo/genpkgmetadata.py", line 307, in <module>
    main(sys.argv[1:])
  File "/usr/share/createrepo/genpkgmetadata.py", line 296, in main
    mdgen.cleanup()
  File "/usr/lib/python2.6/site-packages/createrepo/__init__.py", line 1208, in cleanup
    self._cleanup_update_tmp_dir()
  File "/usr/lib/python2.6/site-packages/createrepo/__init__.py", line 1213, in _cleanup_update_tmp_dir
    self.oldData.cleanup()
AttributeError: MetaDataGenerator instance has no attribute 'oldData'
-----------------

Expected results:
Should not give any error. 

Additional info:

Customer reported also that Lines 294-296 of /usr/share/createrepo/genpkgmetadata.py should be deleted. The traceback happens because self.oldData is not initialised when the code exits in line 261 when there are no new packages.

~~~
#    finally:
#         if mdgen:
#             mdgen.cleanup()
~~~
Comment 2 Ashfaqur Rahaman 2017-06-12 05:16:57 EDT

*** This bug has been marked as a duplicate of bug 1434369 ***

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