+++ This bug was initially created as a clone of Bug #817410 +++ Description of problem: spacewalk-clone-by-date fails and generates a traceback when executed to Sat550 with PostgreSQL. The problem is not presented on Sat 550 with Oracle. Version-Release number of selected component (if applicable): Sat 550 with PostgreSQL. How reproducible: 100% Steps to Reproduce: 1. Create a Custom channel with Child channel 2. Create 100 RPM packages (50 base + 50 updates) 3. Push the packages to the Custom channel. 4. Create 50 Errata from the update packages in the Custom channel. 5. Create 100 RPM packages (50 base + 50 updates) 6. Push the packages to the Chiled channel. 7. Create 50 Errata from the update packages in the Custom channel. 8. Execute: spacewalk-clone-by-date --assumeyes --channel=chann_1 clone-chann_1 --channel=child_chann_1 child_chann_1 --username admin --password admin --to_date=2007-03-06 --blacklist='test-regular-1_chann_1,test-regular-1_child_chann_1' --removelist='test-regular-0_chann_1,test-regular-0_child_chann_1' Actual results: Copying repodata, please wait. Solving Dependencies (100): ________________________________________ ######################################## - complete Processing Dependencies: ________________________________________ ######################################## - complete Traceback (most recent call last): File "/usr/bin/spacewalk-clone-by-date", line 205, in <module> sys.exit(abs(main() or 0)) File "/usr/bin/spacewalk-clone-by-date", line 195, in main return cloneByDate.main(args) File "/usr/share/rhn/utils/cloneByDate.py", line 158, in main tree_cloner.prepare() File "/usr/share/rhn/utils/cloneByDate.py", line 297, in prepare cloner.prepare() File "/usr/share/rhn/utils/cloneByDate.py", line 422, in prepare self.errata_to_clone, self.available_errata = self.get_errata() File "/usr/share/rhn/utils/cloneByDate.py", line 506, in get_errata if err['issue_date'] <= self.to_date: TypeError: can't compare offset-naive and offset-aware datetimes Expected results: PASS. Additional info:
Committed to spacewalk-master: 7e066ddf8b08acc67f2f0eab80545edf600ed728 This error occures only on Postgres because Postgres returns a datetime object with timezone info, whereas Oracle does not. The tool then compares the date with a datetime that does not have timezone info, which is illegal. The fix is simply to compare date objects instead of datetime objects. This is safe becuase errata release timestamps are dates anyway, there is no time info associated with them.
Moving ON_QA. Packages that address this bugzilla should now be available in yum repos at http://yum.spacewalkproject.org/nightly/
Spacewalk 1.8 has been released: https://fedorahosted.org/spacewalk/wiki/ReleaseNotes18