Description of problem: Traceback: Traceback (most recent call last): File "/usr/bin/pulp-admin", line 174, in ? admin.main() File "/usr/lib/python2.4/site-packages/pulp/client/cli/base.py", line 137, in main command.main(args[1:]) File "/usr/lib/python2.4/site-packages/pulp/client/core/base.py", line 118, in main action.main(args[1:]) File "/usr/lib/python2.4/site-packages/pulp/client/core/base.py", line 226, in main self.run() File "/usr/lib/python2.4/site-packages/pulp/client/core/consumer.py", line 92, in run last_heartbeat = json_utils.parse_iso_date(stat[1]) File "/usr/lib/python2.4/site-packages/pulp/client/json_utils.py", line 48, in parse_iso_date return datetime.strptime(iso_str[:19], ISOFORMAT) AttributeError: type object 'datetime.datetime' has no attribute 'strptime' Issue relates to datetime.datetime.strptime() being introduced in python 2.5. Looks like something fairly new we added to pulp with this commit (4/7/11): http://git.fedorahosted.org/git/?p=pulp.git;a=commitdiff;h=1a927fde705ac13de95004e7524018cf006806be
<jortel> alcy: when you get a chance, I believe this: http://www.fpaste.org/n8dI/ is the patch you need. 1. diff --git a/src/pulp/client/json_utils.py b/src/pulp/client/json_utils.py 2. index 1b7af72..e5d8782 100644 3. --- a/src/pulp/client/json_utils.py 4. +++ b/src/pulp/client/json_utils.py 5. @@ -17,6 +17,7 @@ 6. Utilities for parsing and formatting of JSON values. 7. ''' 8. 9. +import time 10. from datetime import datetime 11. 12. ISOFORMAT = '%Y-%m-%dT%H:%M:%S' 13. @@ -45,4 +46,4 @@ def parse_iso_date(iso_str): 14. @return: python object representing the date 15. @rtype: L{datetime.datetime} instance 16. """ 17. - return datetime.strptime(iso_str[:19], ISOFORMAT) 18. + return datetime(*(time.strptime(iso_str[:19], ISOFORMAT)[0:6]))
We need to patch the CR10 Build. This means from tag, as there have already been numerous commits to master.
commit 8a9562f6d9a3741d2220b64914e8e612c04437ba tree fccf733a0d27f426271c473dd89bd657242eaa37 700122 - Fixed ISO date formatting for python 2.4 compatibility. src/pulp/client/json_utils.py test/unit/test_json_utils.py Added a unit test for this as well so we can take advantage of our hudson builders to detect these sorts of incompabilities.
Fixed in Pulp 0.172, grinder 0.96.
verified [root@pulp-qe-rhel5 ~]# pulp-admin consumer list +------------------------------------------+ Consumer Information +------------------------------------------+ [root@pulp-qe-rhel5 ~]# pulp-admin consumer list +------------------------------------------+ Consumer Information +------------------------------------------+ Id rhel5-client Description None Subscribed Repos [] Agent: Responding Yes Last Heartbeat 2011-04-28 17:31:24 Additional info [root@pulp-qe-rhel5 ~]# rpm -q pulp pulp-0.0.172-1 [root@pulp-qe-rhel5 ~]# cat /etc/redhat-release Red Hat Enterprise Linux Server release 5.5 (Tikanga)
Closing with Community Release 15 pulp-0.0.223-4.